Browse Source

* r2 can be used by the register allocator under Darwin
* merged the initialisations of the fpu register allocator for AIX and
SYSV

Jonas Maebe 20 years ago
parent
commit
74cc20070d
2 changed files with 23 additions and 21 deletions
  1. 13 19
      compiler/powerpc/cgcpu.pas
  2. 10 2
      compiler/powerpc/cpupara.pas

+ 13 - 19
compiler/powerpc/cgcpu.pas

@@ -168,7 +168,7 @@ const
               begin
               begin
                 current_procinfo.got:=NR_R31;
                 current_procinfo.got:=NR_R31;
                 rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,
                 rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,
-                  [RS_R3,RS_R4,RS_R5,RS_R6,RS_R7,RS_R8,
+                  [RS_R2,RS_R3,RS_R4,RS_R5,RS_R6,RS_R7,RS_R8,
                    RS_R9,RS_R10,RS_R11,RS_R12,RS_R30,RS_R29,
                    RS_R9,RS_R10,RS_R11,RS_R12,RS_R30,RS_R29,
                    RS_R28,RS_R27,RS_R26,RS_R25,RS_R24,RS_R23,RS_R22,
                    RS_R28,RS_R27,RS_R26,RS_R25,RS_R24,RS_R23,RS_R22,
                    RS_R21,RS_R20,RS_R19,RS_R18,RS_R17,RS_R16,RS_R15,
                    RS_R21,RS_R20,RS_R19,RS_R18,RS_R17,RS_R16,RS_R15,
@@ -176,7 +176,7 @@ const
               end
               end
             else
             else
               rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,
               rg[R_INTREGISTER]:=trgcpu.create(R_INTREGISTER,R_SUBWHOLE,
-                [RS_R3,RS_R4,RS_R5,RS_R6,RS_R7,RS_R8,
+                [RS_R2,RS_R3,RS_R4,RS_R5,RS_R6,RS_R7,RS_R8,
                  RS_R9,RS_R10,RS_R11,RS_R12,RS_R31,RS_R30,RS_R29,
                  RS_R9,RS_R10,RS_R11,RS_R12,RS_R31,RS_R30,RS_R29,
                  RS_R28,RS_R27,RS_R26,RS_R25,RS_R24,RS_R23,RS_R22,
                  RS_R28,RS_R27,RS_R26,RS_R25,RS_R24,RS_R23,RS_R22,
                  RS_R21,RS_R20,RS_R19,RS_R18,RS_R17,RS_R16,RS_R15,
                  RS_R21,RS_R20,RS_R19,RS_R18,RS_R17,RS_R16,RS_R15,
@@ -189,22 +189,11 @@ const
              RS_R28,RS_R27,RS_R26,RS_R25,RS_R24,RS_R23,RS_R22,
              RS_R28,RS_R27,RS_R26,RS_R25,RS_R24,RS_R23,RS_R22,
              RS_R21,RS_R20,RS_R19,RS_R18,RS_R17,RS_R16,RS_R15,
              RS_R21,RS_R20,RS_R19,RS_R18,RS_R17,RS_R16,RS_R15,
              RS_R14,RS_R13],first_int_imreg,[]);
              RS_R14,RS_R13],first_int_imreg,[]);
-        case target_info.abi of
-          abi_powerpc_aix:
-            rg[R_FPUREGISTER]:=trgcpu.create(R_FPUREGISTER,R_SUBNONE,
-                [RS_F0,RS_F1,RS_F2,RS_F3,RS_F4,RS_F5,RS_F6,RS_F7,RS_F8,RS_F9,
-                 RS_F10,RS_F11,RS_F12,RS_F13,RS_F31,RS_F30,RS_F29,RS_F28,RS_F27,
-                 RS_F26,RS_F25,RS_F24,RS_F23,RS_F22,RS_F21,RS_F20,RS_F19,RS_F18,
-                 RS_F17,RS_F16,RS_F15,RS_F14],first_fpu_imreg,[]);
-          abi_powerpc_sysv:
-            rg[R_FPUREGISTER]:=trgcpu.create(R_FPUREGISTER,R_SUBNONE,
-                [RS_F0,RS_F1,RS_F2,RS_F3,RS_F4,RS_F5,RS_F6,RS_F7,RS_F8,RS_F9,
-                 RS_F31,RS_F30,RS_F29,RS_F28,RS_F27,RS_F26,RS_F25,RS_F24,RS_F23,
-                 RS_F22,RS_F21,RS_F20,RS_F19,RS_F18,RS_F17,RS_F16,RS_F15,RS_F14,
-                 RS_F13,RS_F12,RS_F11,RS_F10],first_fpu_imreg,[]);
-          else
-            internalerror(2003122903);
-        end;
+        rg[R_FPUREGISTER]:=trgcpu.create(R_FPUREGISTER,R_SUBNONE,
+            [RS_F0,RS_F1,RS_F2,RS_F3,RS_F4,RS_F5,RS_F6,RS_F7,RS_F8,RS_F9,
+             RS_F10,RS_F11,RS_F12,RS_F13,RS_F31,RS_F30,RS_F29,RS_F28,RS_F27,
+             RS_F26,RS_F25,RS_F24,RS_F23,RS_F22,RS_F21,RS_F20,RS_F19,RS_F18,
+             RS_F17,RS_F16,RS_F15,RS_F14],first_fpu_imreg,[]);
         {$warning FIX ME}
         {$warning FIX ME}
         rg[R_MMREGISTER]:=trgcpu.create(R_MMREGISTER,R_SUBNONE,
         rg[R_MMREGISTER]:=trgcpu.create(R_MMREGISTER,R_SUBNONE,
             [RS_M0,RS_M1,RS_M2],first_mm_imreg,[]);
             [RS_M0,RS_M1,RS_M2],first_mm_imreg,[]);
@@ -2358,7 +2347,12 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.191  2005-01-10 21:50:05  jonas
+  Revision 1.192  2005-01-13 22:02:40  jonas
+    * r2 can be used by the register allocator under Darwin
+    * merged the initialisations of the fpu register allocator for AIX and
+      SYSV
+
+  Revision 1.191  2005/01/10 21:50:05  jonas
     + support for passing records in registers under darwin
     + support for passing records in registers under darwin
     * tcgpara now also has an intsize field, which contains the size in
     * tcgpara now also has an intsize field, which contains the size in
       bytes of the whole parameter
       bytes of the whole parameter

+ 10 - 2
compiler/powerpc/cpupara.pas

@@ -64,7 +64,10 @@ unit cpupara;
 
 
     function tppcparamanager.get_volatile_registers_int(calloption : tproccalloption):tcpuregisterset;
     function tppcparamanager.get_volatile_registers_int(calloption : tproccalloption):tcpuregisterset;
       begin
       begin
-        result := [RS_R3..RS_R12];
+        if (target_info.system = system_powerpc_darwin) then
+          result := [RS_R2..RS_R12]
+        else
+          result := [RS_R3..RS_R12];
       end;
       end;
 
 
 
 
@@ -657,7 +660,12 @@ begin
 end.
 end.
 {
 {
   $Log$
   $Log$
-  Revision 1.82  2005-01-13 19:32:08  jonas
+  Revision 1.83  2005-01-13 22:02:40  jonas
+    * r2 can be used by the register allocator under Darwin
+    * merged the initialisations of the fpu register allocator for AIX and
+      SYSV
+
+  Revision 1.82  2005/01/13 19:32:08  jonas
     * fixed copy_value_on_stack() for AIX abi
     * fixed copy_value_on_stack() for AIX abi
     + added support for passing empty record parameters
     + added support for passing empty record parameters