Selaa lähdekoodia

+ i8086 asm implementation of fpc_frac_real, based on the i386 version

git-svn-id: trunk@26131 -
nickysn 11 vuotta sitten
vanhempi
commit
bb0a3a7374
1 muutettua tiedostoa jossa 18 lisäystä ja 0 poistoa
  1. 18 0
      rtl/i8086/math.inc

+ 18 - 0
rtl/i8086/math.inc

@@ -117,6 +117,24 @@
         fstp st(1)
      end;
 
+    {$define FPC_SYSTEM_HAS_FRAC}
+    function fpc_frac_real(d : ValReal) : ValReal;assembler;compilerproc;
+      asm
+        sub sp, 2
+        fnstcw [bp-2]
+        fwait
+        mov cx, [bp-2]
+        or word [bp-2], $0f00
+        fldcw [bp-2]
+        fld tbyte [d]
+        frndint
+        fld tbyte [d]
+        fsub st, st(1)
+        fstp st(1)
+        mov [bp-2], cx
+        fldcw [bp-2]
+      end;
+
     {$define FPC_SYSTEM_HAS_INT}
     function fpc_int_real(d : ValReal) : ValReal;assembler;compilerproc;
       asm