Browse Source

* simplify SysInitFPU assmebler using local variables

git-svn-id: trunk@14390 -
pierre 15 years ago
parent
commit
05c1097395
1 changed files with 9 additions and 10 deletions
  1. 9 10
      rtl/x86_64/x86_64.inc

+ 9 - 10
rtl/x86_64/x86_64.inc

@@ -595,19 +595,18 @@ const
 
 
 {$define FPC_SYSTEM_HAS_SYSINITFPU}
 {$define FPC_SYSTEM_HAS_SYSINITFPU}
 Procedure SysInitFPU;
 Procedure SysInitFPU;
+  var
+    { these locals are so we don't have to hack pic code in the assembler }
+    localmxcsr: dword;
+    localfpucw: word;
+ 
 begin
 begin
+  localmxcsr:=mxcsr;
+  localfpucw:=fpucw;
   asm
   asm
-{$ifdef FPC_PIC}
-    movq fpucw@GOTPCREL(%rip),%rax
-    fldcw (%rax)
-    { set sse exceptions }
-    movq mxcsr@GOTPCREL(%rip),%rax
-    ldmxcsr (%rax)
-{$else FPC_PIC}
-    fldcw fpucw{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
+    fldcw localfpucw
     { set sse exceptions }
     { set sse exceptions }
-    ldmxcsr mxcsr{$ifdef FPC_HAS_RIP_RELATIVE}(%rip){$endif}
-{$endif FPC_PIC}
+    ldmxcsr localmxcsr
   end ['RAX'];
   end ['RAX'];
   { x86-64 might use softfloat code }
   { x86-64 might use softfloat code }
   softfloat_exception_mask:=float_flag_underflow or float_flag_inexact or float_flag_denormal;
   softfloat_exception_mask:=float_flag_underflow or float_flag_inexact or float_flag_denormal;