Browse Source

* fixed exp to be pic safe

git-svn-id: trunk@1573 -
florian 20 years ago
parent
commit
8711adb9d1
1 changed files with 7 additions and 15 deletions
  1. 7 15
      rtl/x86_64/math.inc

+ 7 - 15
rtl/x86_64/math.inc

@@ -125,18 +125,19 @@ FPC_ABSMASK_DOUBLE:
     {$define FPC_SYSTEM_HAS_EXP}
     {$define FPC_SYSTEM_HAS_EXP}
     function fpc_exp_real(d : ValReal) : ValReal;assembler;compilerproc;
     function fpc_exp_real(d : ValReal) : ValReal;assembler;compilerproc;
        asm
        asm
+            subq        $16,%rsp
             // comes from DJ GPP
             // comes from DJ GPP
             fldt        d
             fldt        d
             fldl2e
             fldl2e
             fmulp       %st,%st(1)
             fmulp       %st,%st(1)
-            fstcw      .LCW1
-            fstcw      .LCW2
-            andw        $0xf3ff,.LCW2
-            orw         $0x0400,.LCW2
-            fldcw      .LCW2
+            fstcw       -2(%rbp)
+            fstcw       -4(%rbp)
+            andw        $0xf3ff,-4(%rbp)
+            orw         $0x0400,-4(%rbp)
+            fldcw       -4(%rbp)
             fld         %st(0)
             fld         %st(0)
             frndint
             frndint
-            fldcw      .LCW1
+            fldcw       -2(%rbp)
             fxch        %st(1)
             fxch        %st(1)
             fsub        %st(1),%st
             fsub        %st(1),%st
             f2xm1
             f2xm1
@@ -144,15 +145,6 @@ FPC_ABSMASK_DOUBLE:
             faddp       %st,%st(1)
             faddp       %st,%st(1)
             fscale
             fscale
             fstp        %st(1)
             fstp        %st(1)
-            jmp         .LCW3
-            // store some help data in the data segment
-        .data
-        .LCW1:
-            .word       0
-        .LCW2:
-            .word       0
-        .text
-        .LCW3:
       end;
       end;