Selaa lähdekoodia

+ added fpc_exp_real for i8086

git-svn-id: branches/i8086@23841 -
nickysn 12 vuotta sitten
vanhempi
commit
ca1fad8a73
1 muutettua tiedostoa jossa 27 lisäystä ja 0 poistoa
  1. 27 0
      rtl/i8086/math.inc

+ 27 - 0
rtl/i8086/math.inc

@@ -76,6 +76,33 @@
       result:=0;
     end;
 
+    {$define FPC_SYSTEM_HAS_EXP}
+    function fpc_exp_real(d : ValReal) : ValReal;assembler;compilerproc;
+      var
+        cw1,cw2: word;
+      asm
+        // comes from DJ GPP
+        fld tbyte[d]
+        fldl2e
+        fmulp st1, st
+        fstcw CW1
+        fstcw CW2
+        fwait
+        and CW2, $f3ff
+        orw CW2, $0400
+        fldcw CW2
+        fld st0
+        frndint
+        fldcw CW1
+        fxch st1
+        fsub st, st1
+        f2xm1
+        fld1
+        faddp st1, st
+        fscale
+        fstp st1
+     end;
+
     {$define FPC_SYSTEM_HAS_INT}
     function fpc_int_real(d : ValReal) : ValReal;assembler;compilerproc;
       asm