Browse Source

* some ifdef'ed pic code

florian 20 years ago
parent
commit
58202bd7d5
2 changed files with 27 additions and 6 deletions
  1. 11 1
      rtl/x86_64/math.inc
  2. 16 5
      rtl/x86_64/x86_64.inc

+ 11 - 1
rtl/x86_64/math.inc

@@ -21,9 +21,16 @@
     procedure Set8087CW(cw:word);assembler;
     procedure Set8087CW(cw:word);assembler;
     asm
     asm
       movw cw,%ax
       movw cw,%ax
+{$ifdef FPC_PIC}
+      movq default8087cw@GOTPCREL(%rip),%rax
+      movw %ax,(%rax)
+      fnclex
+      fldcw (%rax)
+{$else FPC_PIC}
       movw %ax,default8087cw
       movw %ax,default8087cw
       fnclex
       fnclex
       fldcw default8087cw
       fldcw default8087cw
+{$endif FPC_PIC}
     end;
     end;
 
 
     function Get8087CW:word;assembler;
     function Get8087CW:word;assembler;
@@ -278,7 +285,10 @@
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.9  2005-02-14 17:13:32  peter
+  Revision 1.10  2005-04-25 09:40:27  florian
+    * some ifdef'ed pic code
+
+  Revision 1.9  2005/02/14 17:13:32  peter
     * truncate log
     * truncate log
 
 
   Revision 1.8  2005/01/30 18:41:53  peter
   Revision 1.8  2005/01/30 18:41:53  peter

+ 16 - 5
rtl/x86_64/x86_64.inc

@@ -252,7 +252,7 @@ function declocked(var l : longint) : boolean;assembler;
      { this check should be done because a lock takes a lot }
      { this check should be done because a lock takes a lot }
      { of time!                                             }
      { of time!                                             }
 {$ifdef FPC_PIC}
 {$ifdef FPC_PIC}
-     movq       IsMultithreaded@GOTPCREL(%rip),%rax
+     movq       IsMultithread@GOTPCREL(%rip),%rax
      cmpb       $0,(%rax)
      cmpb       $0,(%rax)
 {$else FPC_PIC}
 {$else FPC_PIC}
      cmpb       $0,IsMultithread
      cmpb       $0,IsMultithread
@@ -277,7 +277,7 @@ function declocked(var l : int64) : boolean;assembler;
      { this check should be done because a lock takes a lot }
      { this check should be done because a lock takes a lot }
      { of time!                                             }
      { of time!                                             }
 {$ifdef FPC_PIC}
 {$ifdef FPC_PIC}
-     movq       IsMultithreaded@GOTPCREL(%rip),%rax
+     movq       IsMultithread@GOTPCREL(%rip),%rax
      cmpb       $0,(%rax)
      cmpb       $0,(%rax)
 {$else FPC_PIC}
 {$else FPC_PIC}
      cmpb       $0,IsMultithread
      cmpb       $0,IsMultithread
@@ -303,7 +303,7 @@ procedure inclocked(var l : longint);assembler;
      { this check should be done because a lock takes a lot }
      { this check should be done because a lock takes a lot }
      { of time!                                             }
      { of time!                                             }
 {$ifdef FPC_PIC}
 {$ifdef FPC_PIC}
-     movq       IsMultithreaded@GOTPCREL(%rip),%rax
+     movq       IsMultithread@GOTPCREL(%rip),%rax
      cmpb       $0,(%rax)
      cmpb       $0,(%rax)
 {$else FPC_PIC}
 {$else FPC_PIC}
      cmpb       $0,IsMultithread
      cmpb       $0,IsMultithread
@@ -328,7 +328,7 @@ procedure inclocked(var l : int64);assembler;
      { this check should be done because a lock takes a lot }
      { this check should be done because a lock takes a lot }
      { of time!                                             }
      { of time!                                             }
 {$ifdef FPC_PIC}
 {$ifdef FPC_PIC}
-     movq       IsMultithreaded@GOTPCREL(%rip),%rax
+     movq       IsMultithread@GOTPCREL(%rip),%rax
      cmpb       $0,(%rax)
      cmpb       $0,(%rax)
 {$else FPC_PIC}
 {$else FPC_PIC}
      cmpb       $0,IsMultithread
      cmpb       $0,IsMultithread
@@ -374,14 +374,25 @@ asm
   { initialize fpu }
   { initialize fpu }
   fninit
   fninit
   fwait
   fwait
+{$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
   fldcw fpucw
   { set sse exceptions }
   { set sse exceptions }
   ldmxcsr mxcsr
   ldmxcsr mxcsr
+{$endif FPC_PIC}
 end;
 end;
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.19  2005-02-14 17:13:32  peter
+  Revision 1.20  2005-04-25 09:40:27  florian
+    * some ifdef'ed pic code
+
+  Revision 1.19  2005/02/14 17:13:32  peter
     * truncate log
     * truncate log
 
 
   Revision 1.18  2005/02/05 22:30:50  florian
   Revision 1.18  2005/02/05 22:30:50  florian