ソースを参照

Add pseudo PIC code for 32-bit powerpc, probably wrong :-(

Pierre Muller 1 年間 前
コミット
2ad20b3787
1 ファイル変更17 行追加7 行削除
  1. 17 7
      rtl/powerpc/math.inc

+ 17 - 7
rtl/powerpc/math.inc

@@ -77,7 +77,8 @@ const
         addis  r4,r5,(factor-.Lpiclab)@ha
         lfd    f2,(factor-.Lpiclab)@l(r4)
         {$else darwin}
-        {$error Add pic code for linux/ppc32}
+        lis    r4,(factor)@ha
+        lfd    f2,(factor)@l(r4)
         {$endif darwin}
         {$else FPC_PIC}
         lis    r4,factor@ha
@@ -107,7 +108,8 @@ const
         addis  r4,r5,(longint_to_real_helper-.Lpiclab)@ha
         lfd    f0,(longint_to_real_helper-.Lpiclab)@l(r4)
         {$else darwin}
-        {$error Add pic code for linux/ppc32}
+        lis    r4,(longint_to_real_helper)@ha
+        lfd    f0,(longint_to_real_helper)@l(r4)
         {$endif darwin}
         {$else FPC_PIC}
         lis    r4,longint_to_real_helper@ha
@@ -133,7 +135,8 @@ const
         addis  r4,r5,(factor2-.Lpiclab)@ha
         lfd    f2,(factor2-.Lpiclab)@l(r4)
         {$else darwin}
-        {$error Add pic code for linux/ppc32}
+        lis    r4,(factor2)@ha
+        lfd    f2,(factor2)@l(r4)
         {$endif darwin}
         {$else FPC_PIC}
         lis    r4,factor2@ha
@@ -297,7 +300,8 @@ asm
            addis  r3,r5,(longint_to_real_helper-.Lpiclab)@ha
            lfd    f1,(longint_to_real_helper-.Lpiclab)@l(r3)
            {$else darwin}
-           {$error Add pic code for linux/ppc32}
+           lis    r3,(longint_to_real_helper)@ha
+           lfd    f1,(longint_to_real_helper)@l(r3)
            {$endif darwin}
            {$else FPC_PIC}
            lis    r3,longint_to_real_helper@ha
@@ -319,7 +323,11 @@ asm
            lfd    f3,temp
            lfd    f2,(int_to_real_factor-.Lpiclab)@l(r4)
            {$else darwin}
-           {$error Add pic code for linux/ppc32}
+           lis    r4,(cardinal_to_real_helper)@ha
+           lfd    f1,(cardinal_to_real_helper)@l(r4)
+           lis    r4,(int_to_real_factor)@ha
+           lfd    f3,temp
+           lfd    f2,(int_to_real_factor)@l(r4)
            {$endif darwin}
            {$else FPC_PIC}
            lis    r4,cardinal_to_real_helper@ha
@@ -367,7 +375,8 @@ asm
            addis  r3,r5,(cardinal_to_real_helper-.Lpiclab)@ha
            lfd    f1,(cardinal_to_real_helper-.Lpiclab)@l(r3)
            {$else darwin}
-           {$error Add pic code for linux/ppc32}
+           lis    r3,(cardinal_to_real_helper)@ha
+           lfd    f1,(cardinal_to_real_helper)@l(r3)
            {$endif darwin}
            {$else FPC_PIC}
            lis    r3,cardinal_to_real_helper@ha
@@ -386,7 +395,8 @@ asm
            addis  r4,r5,(int_to_real_factor-.Lpiclab)@ha
            lfd    f2,(int_to_real_factor-.Lpiclab)@l(r4)
            {$else darwin}
-           {$error Add pic code for linux/ppc32}
+           lis    r4,(int_to_real_factor)@ha
+           lfd    f2,(int_to_real_factor)@l(r4)
            {$endif darwin}
            {$else FPC_PIC}
            lis    r4,int_to_real_factor@ha