2
0
Эх сурвалжийг харах

+ the ppc gas assembler writer adds now registers aliases
to the assembler file

florian 23 жил өмнө
parent
commit
0d1a344d7f

+ 10 - 2
compiler/aggas.pas

@@ -49,6 +49,7 @@ interface
       public
         procedure WriteTree(p:TAAsmoutput);override;
         procedure WriteAsmList;override;
+        procedure WriteExtraHeader;virtual;
 {$ifdef GDB}
         procedure WriteFileLineInfo(var fileinfo : tfileposinfo);
         procedure WriteFileEndInfo;
@@ -720,7 +721,10 @@ var
     end;
 
 
+    procedure TGNUAssembler.WriteExtraHeader;
 
+      begin
+      end;
 
     procedure TGNUAssembler.WriteAsmList;
     var
@@ -754,7 +758,7 @@ var
        end;
     { to get symify to work }
       AsmWriteLn(#9'.file "'+FixFileName(n+e)+'"');
-
+      WriteExtraHeader;
 {$ifdef GDB}
       n_line:=n_bssline;
       funcname:=nil;
@@ -796,7 +800,11 @@ var
 end.
 {
   $Log$
-  Revision 1.9  2002-08-18 20:06:23  peter
+  Revision 1.10  2002-08-18 22:16:14  florian
+    + the ppc gas assembler writer adds now registers aliases
+      to the assembler file
+
+  Revision 1.9  2002/08/18 20:06:23  peter
     * inlining is now also allowed in interface
     * renamed write/load to ppuwrite/ppuload
     * tnode storing in ppu

+ 17 - 2
compiler/powerpc/agppcgas.pas

@@ -37,6 +37,7 @@ unit agppcgas;
     type
       PPPCGNUAssembler=^TPPCGNUAssembler;
       TPPCGNUAssembler=class(TGNUassembler)
+        procedure WriteExtraHeader;override;
         procedure WriteInstruction(hp : tai);override;
       end;
 
@@ -64,6 +65,16 @@ unit agppcgas;
        assemble,
        aasmcpu;
 
+    procedure TPPCGNUAssembler.WriteExtraHeader;
+      var
+         i : longint;
+      begin
+         for i:=0 to 31 do
+           AsmWriteln(#9'.set'#9'r'+tostr(i)+','+tostr(i));
+         for i:=0 to 31 do
+           AsmWriteln(#9'.set'#9'f'+tostr(i)+','+tostr(i));
+      end;
+
     const
        as_ppc_gas_info : tasminfo =
           (
@@ -128,7 +139,7 @@ unit agppcgas;
          'insrwi.', 'rotlwi', 'rotlwi.', 'rotlw', 'rotlw.', 'slwi', 'slwi.',
          'srwi', 'srwi.', 'clrlwi', 'clrlwi.', 'clrrwi', 'clrrwi.', 'clrslwi',
          'clrslwi.', 'blr', 'bctr', 'blrl', 'bctrl', 'crset', 'crclr', 'crmove',
-         'crnot', 'mt', 'mf','nop', 'li', 'lis', 'la', 'mr','mr.','not', 'mtcr');
+         'crnot', 'mt', 'mf','nop', 'li', 'lis', 'la', 'mr','mr.','not', 'mtcr', 'mtlr', 'mflr');
 
      symaddr2str: array[trefsymaddr] of string[2] = ('','@ha','@l');
 
@@ -355,7 +366,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.13  2002-08-18 21:36:42  florian
+  Revision 1.14  2002-08-18 22:16:14  florian
+    + the ppc gas assembler writer adds now registers aliases
+      to the assembler file
+
+  Revision 1.13  2002/08/18 21:36:42  florian
     + handling of local variables in direct reader implemented
 
   Revision 1.12  2002/08/18 10:34:30  florian

+ 7 - 3
compiler/powerpc/cgcpu.pas

@@ -892,7 +892,7 @@ const
         if (procinfo.flags and pi_do_call)<>0 then
           begin
              { save return address... }
-             list.concat(taicpu.op_reg_reg(A_MFSPR,R_0,R_LR));
+             list.concat(taicpu.op_reg(A_MFLR,R_0));
              { ... in caller's rframe }
              reference_reset_base(href,STACK_POINTER_REG,4);
              list.concat(taicpu.op_reg_ref(A_STW,R_0,href));
@@ -1067,7 +1067,7 @@ const
                begin
                   reference_reset_base(href,STACK_POINTER_REG,4);
                   list.concat(taicpu.op_reg_ref(A_LWZ,R_0,href));
-                  list.concat(taicpu.op_reg_reg(A_MTSPR,R_LR,R_0));
+                  list.concat(taicpu.op_reg(A_MTLR,R_0));
                end;
              list.concat(taicpu.op_none(A_BLR));
           end;
@@ -1674,7 +1674,11 @@ begin
 end.
 {
   $Log$
-  Revision 1.44  2002-08-17 18:23:53  florian
+  Revision 1.45  2002-08-18 22:16:14  florian
+    + the ppc gas assembler writer adds now registers aliases
+      to the assembler file
+
+  Revision 1.44  2002/08/17 18:23:53  florian
     * some assembler writer bugs fixed
 
   Revision 1.43  2002/08/17 09:23:49  florian

+ 6 - 2
compiler/powerpc/cpubase.pas

@@ -83,7 +83,7 @@ uses
         a_srwi, a_srwi_, a_clrlwi, a_clrlwi_, a_clrrwi, a_clrrwi_, a_clrslwi,
         a_clrslwi_, a_blr, a_bctr, a_blrl, a_bctrl, a_crset, a_crclr, a_crmove,
         a_crnot, a_mt {move to special prupose reg}, a_mf {move from special purpose reg},
-        a_nop, a_li, a_lis, a_la, a_mr, a_mr_, a_not, a_mtcr);
+        a_nop, a_li, a_lis, a_la, a_mr, a_mr_, a_not, a_mtcr, a_mtlr, a_mflr);
 
       {# This should define the array of instructions as string }
       op2strtable=array[tasmop] of string[8];
@@ -709,7 +709,11 @@ implementation
 end.
 {
   $Log$
-  Revision 1.29  2002-08-18 21:36:42  florian
+  Revision 1.30  2002-08-18 22:16:15  florian
+    + the ppc gas assembler writer adds now registers aliases
+      to the assembler file
+
+  Revision 1.29  2002/08/18 21:36:42  florian
     + handling of local variables in direct reader implemented
 
   Revision 1.28  2002/08/14 18:41:47  jonas