Ver código fonte

* access the Default8087CW global variable directly from within inline asm,
instead of copying it to a local var first, since the concern about PIC code
(this asm code started out as a copy of the i386 rtl code) doesn't exist on
the i8086, since there's no such thing as PIC code on the i8086

git-svn-id: trunk@41311 -

nickysn 6 anos atrás
pai
commit
4f573b50ad
2 arquivos alterados com 11 adições e 26 exclusões
  1. 10 22
      rtl/i8086/i8086.inc
  2. 1 4
      rtl/msdos/system.pp

+ 10 - 22
rtl/i8086/i8086.inc

@@ -1197,33 +1197,21 @@ procedure DetectFPU;
 
 {$ifndef FPC_SYSTEM_HAS_SYSINITFPU}
 {$define FPC_SYSTEM_HAS_SYSINITFPU}
-Procedure SysInitFPU;
-  var
-    { these locals are so we don't have to hack pic code in the assembler }
-    localfpucw: word;
-  begin
-    localfpucw:=Default8087CW;
-    asm
-      fninit
-      fldcw   localfpucw
-      fwait
-    end;
+Procedure SysInitFPU; assembler;
+  asm
+    fninit
+    fldcw   Default8087CW
+    fwait
   end;
 
 {$endif ndef FPC_SYSTEM_HAS_SYSINITFPU}
 
 {$define FPC_SYSTEM_HAS_SYSRESETFPU}
-Procedure SysResetFPU;
-  var
-    { these locals are so we don't have to hack pic code in the assembler }
-    localfpucw: word;
-  begin
-    localfpucw:=Default8087CW;
-    asm
-      fninit
-      fwait
-      fldcw   localfpucw
-    end;
+Procedure SysResetFPU; assembler;
+  asm
+    fninit
+    fwait
+    fldcw   Default8087CW
   end;
 
 {$I int32p.inc}

+ 1 - 4
rtl/msdos/system.pp

@@ -168,8 +168,6 @@ Procedure SysInitFPU;
     CR0_NE = $20;
     CR0_NOT_NE = $FFFF - CR0_NE;
   var
-    { these locals are so we don't have to hack pic code in the assembler }
-    localfpucw: word;
     prevInt06 : FarPointer;
     _newcr0_lw : word;
     restore_old_int10 : boolean;
@@ -177,10 +175,9 @@ Procedure SysInitFPU;
 
   begin
     restore_old_int10:=false;
-    localfpucw:=Default8087CW;
     asm
       fninit
-      fldcw   localfpucw
+      fldcw   Default8087CW
       fwait
     end;
     if Test8087 < 3 then { i8087/i80287 do not have "native" exception mode (CR0:NE) }