Browse Source

* i8086: added assembler implementation of fpc_round_real and removed remaining softfloat dependencies.

git-svn-id: trunk@27195 -
sergei 11 years ago
parent
commit
b89822d3e9
3 changed files with 14 additions and 3 deletions
  1. 0 2
      rtl/i8086/i8086.inc
  2. 14 0
      rtl/i8086/math.inc
  3. 0 1
      rtl/i8086/mathu.inc

+ 0 - 2
rtl/i8086/i8086.inc

@@ -457,7 +457,6 @@ Procedure SysInitFPU;
       fldcw   localfpucw
       fldcw   localfpucw
       fwait
       fwait
     end;
     end;
-    softfloat_exception_mask:=float_flag_underflow or float_flag_inexact or float_flag_denormal;
   end;
   end;
 
 
 
 
@@ -474,7 +473,6 @@ Procedure SysResetFPU;
       fwait
       fwait
       fldcw   localfpucw
       fldcw   localfpucw
     end;
     end;
-    softfloat_exception_flags:=0;
   end;
   end;
 
 
 {$I int32p.inc}
 {$I int32p.inc}

+ 14 - 0
rtl/i8086/math.inc

@@ -275,3 +275,17 @@
         mov ax, [bp-2]
         mov ax, [bp-2]
       end;
       end;
 
 
+    {$define FPC_SYSTEM_HAS_ROUND}
+    function fpc_round_real(d : ValReal) : int64;assembler;compilerproc;
+      var
+        tmp: int64;
+      asm
+        fld    tbyte [d]
+        fistp  qword [tmp]
+        fwait
+        mov  dx, [tmp]
+        mov  cx, [tmp+2]
+        mov  bx, [tmp+4]
+        mov  ax, [tmp+6]
+      end;
+

+ 0 - 1
rtl/i8086/mathu.inc

@@ -185,7 +185,6 @@ begin
   Set8087CW( (CtlWord and $FFC0) or Byte(Mask) );
   Set8087CW( (CtlWord and $FFC0) or Byte(Mask) );
 {  if has_sse_support then
 {  if has_sse_support then
     SetSSECSR((GetSSECSR and $ffffe07f) or (dword(Mask) shl 7));}
     SetSSECSR((GetSSECSR and $ffffe07f) or (dword(Mask) shl 7));}
-  softfloat_exception_mask:=byte(Mask);
   Result := TFPUExceptionMask(Byte(CtlWord and $3F));
   Result := TFPUExceptionMask(Byte(CtlWord and $3F));
 end;
 end;