瀏覽代碼

* fixed exp to be pic safe

git-svn-id: trunk@1573 -
florian 20 年之前
父節點
當前提交
8711adb9d1
共有 1 個文件被更改,包括 7 次插入15 次删除
  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}
     function fpc_exp_real(d : ValReal) : ValReal;assembler;compilerproc;
        asm
+            subq        $16,%rsp
             // comes from DJ GPP
             fldt        d
             fldl2e
             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)
             frndint
-            fldcw      .LCW1
+            fldcw       -2(%rbp)
             fxch        %st(1)
             fsub        %st(1),%st
             f2xm1
@@ -144,15 +145,6 @@ FPC_ABSMASK_DOUBLE:
             faddp       %st,%st(1)
             fscale
             fstp        %st(1)
-            jmp         .LCW3
-            // store some help data in the data segment
-        .data
-        .LCW1:
-            .word       0
-        .LCW2:
-            .word       0
-        .text
-        .LCW3:
       end;