瀏覽代碼

* updates for new ra

peter 22 年之前
父節點
當前提交
d76dc1047e
共有 6 個文件被更改,包括 53 次插入42 次删除
  1. 11 2
      compiler/sparc/aasmcpu.pas
  2. 21 1
      compiler/sparc/cgcpu.pas
  3. 6 3
      compiler/sparc/cpubase.pas
  4. 6 23
      compiler/sparc/cpupara.pas
  5. 5 2
      compiler/sparc/cpupi.pas
  6. 4 11
      compiler/sparc/rgcpu.pas

+ 11 - 2
compiler/sparc/aasmcpu.pas

@@ -218,7 +218,13 @@ implementation
 
     function taicpu.is_nop:boolean;
       begin
-        result:=(opcode=A_NOP);
+        { Note: This should not check for A_NOP, because that is
+          used for the delay slots }
+        result:=(opcode=A_MOV) and
+                (ops=2) and
+                (oper[0].typ=top_reg) and
+                (oper[1].typ=top_reg) and
+                (oper[0].reg=oper[1].reg);
       end;
 
 
@@ -291,7 +297,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.32  2003-09-03 15:55:01  peter
+  Revision 1.33  2003-09-14 19:19:04  peter
+    * updates for new ra
+
+  Revision 1.32  2003/09/03 15:55:01  peter
     * NEWRA branch merged
 
   Revision 1.31.2.1  2003/08/31 21:08:16  peter

+ 21 - 1
compiler/sparc/cgcpu.pas

@@ -37,6 +37,8 @@ interface
       protected
         function IsSimpleRef(const ref:treference):boolean;
      public
+        procedure init_register_allocators;override;
+        procedure done_register_allocators;override;
         { sparc special, needed by cg64 }
         procedure handle_load_store(list:taasmoutput;isstore:boolean;op: tasmop;reg:tregister;ref: treference);
         procedure handle_reg_const_reg(list:taasmoutput;op:Tasmop;src:tregister;a:aword;dst:tregister);
@@ -218,6 +220,21 @@ implementation
                               Assembler code
 ****************************************************************************}
 
+    procedure Tcgsparc.init_register_allocators;
+      begin
+        rg:=Trgcpu.create(15,chr(RS_O0)+chr(RS_O1)+chr(RS_O2)+chr(RS_O3)+
+                             chr(RS_O4)+chr(RS_O5)+chr(RS_O7)+
+                             chr(RS_L0)+chr(RS_L1)+chr(RS_L2)+chr(RS_L3)+
+                             chr(RS_L4)+chr(RS_L5)+chr(RS_L6)+chr(RS_L7));
+      end;
+
+
+    procedure Tcgsparc.done_register_allocators;
+      begin
+        rg.free;
+      end;
+
+
     function TCgSparc.reg_cgsize(const reg:tregister):tcgsize;
       begin
         result:=OS_32;
@@ -1090,7 +1107,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.66  2003-09-03 15:55:01  peter
+  Revision 1.67  2003-09-14 19:19:04  peter
+    * updates for new ra
+
+  Revision 1.66  2003/09/03 15:55:01  peter
     * NEWRA branch merged
 
   Revision 1.65.2.1  2003/09/01 21:02:55  peter

+ 6 - 3
compiler/sparc/cpubase.pas

@@ -73,8 +73,8 @@ uses
 
       { Integer Super registers first and last }
 {$warning Supreg shall be $00-$1f}
-      first_int_supreg = RS_O0;
-      last_int_supreg = RS_L7;
+      first_int_supreg = $00;
+      last_int_supreg = $1f;
 
       first_int_imreg = $20;
       last_int_imreg = $fe;
@@ -626,7 +626,10 @@ implementation
 end.
 {
   $Log$
-  Revision 1.49  2003-09-03 16:29:37  peter
+  Revision 1.50  2003-09-14 19:19:05  peter
+    * updates for new ra
+
+  Revision 1.49  2003/09/03 16:29:37  peter
     * superregisters also from .dat file
 
   Revision 1.48  2003/09/03 15:55:01  peter

+ 6 - 23
compiler/sparc/cpupara.pas

@@ -36,9 +36,7 @@ interface
         {Returns a structure giving the information on the storage of the parameter
         (which must be an integer parameter)
         @param(nr Parameter number of routine, starting from 1)}
-        function getintparaloc(list: taasmoutput; nr : longint) : tparalocation;override;
-        procedure freeintparaloc(list: taasmoutput; nr : longint); override;
-        {Creates location information related to the parameter of the function}
+        function getintparaloc(calloption : tproccalloption; nr : longint) : tparalocation;override;
         procedure allocparaloc(list: taasmoutput; const loc: tparalocation);override;
         procedure freeparaloc(list: taasmoutput; const loc: tparalocation);override;
         procedure create_paraloc_info(p:TAbstractProcDef; side: tcallercallee);override;
@@ -81,7 +79,7 @@ implementation
       end;
 
 
-    function TSparcParaManager.GetIntParaLoc(List:TAasmOutput;nr:longint):TParaLocation;
+    function TSparcParaManager.GetIntParaLoc(calloption : tproccalloption; nr : longint) : tparalocation;
       begin
         if nr<1 then
           InternalError(2002100806);
@@ -94,7 +92,6 @@ implementation
             begin
               loc:=LOC_REGISTER;
               register:=newreg(R_INTREGISTER,(RS_O0+nr),R_SUBWHOLE);
-              rg.getexplicitregisterint(list,register);
             end
            else
            { The other parameters are passed on the stack }
@@ -108,23 +105,6 @@ implementation
       end;
 
 
-    procedure tsparcparamanager.freeintparaloc(list: taasmoutput; nr : longint);
-
-      var
-        hreg : tregister;
-
-      begin
-        if nr<1 then
-          internalerror(2003060401);
-        Dec(nr);
-        if nr<6 then
-          begin
-            hreg:=newreg(R_INTREGISTER,RS_O0+nr,R_SUBWHOLE);
-            rg.ungetregisterint(list,hreg);
-          end;
-      end;
-
-
     procedure tsparcparamanager.allocparaloc(list: taasmoutput; const loc: tparalocation);
       begin
         if (loc.loc=LOC_REFERENCE) and
@@ -291,7 +271,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.28  2003-09-03 15:55:01  peter
+  Revision 1.29  2003-09-14 19:19:05  peter
+    * updates for new ra
+
+  Revision 1.28  2003/09/03 15:55:01  peter
     * NEWRA branch merged
 
   Revision 1.27.2.1  2003/08/31 21:08:16  peter

+ 5 - 2
compiler/sparc/cpupi.pas

@@ -77,7 +77,7 @@ implementation
             <register window save area for calling>
           %sp
         }
-        result:=Align(tg.lasttemp+savearea,4);
+        result:=Align(tg.direction*tg.lasttemp+savearea,4);
       end;
 
 
@@ -86,7 +86,10 @@ begin
 end.
 {
   $Log$
-  Revision 1.20  2003-09-03 15:55:01  peter
+  Revision 1.21  2003-09-14 19:19:05  peter
+    * updates for new ra
+
+  Revision 1.20  2003/09/03 15:55:01  peter
     * NEWRA branch merged
 
   Revision 1.19.2.1  2003/09/01 21:02:55  peter

+ 4 - 11
compiler/sparc/rgcpu.pas

@@ -38,7 +38,6 @@ interface
       trgcpu=class(trgobj)
         function GetRegisterFpu(list:TAasmOutput;size:Tcgsize):TRegister;override;
         procedure UngetRegisterFpu(list:taasmoutput;reg:tregister;size:TCGsize);override;
-        procedure ClearTempGen;override;
       end;
 
 
@@ -103,19 +102,13 @@ implementation
         list.concat(tai_regalloc.dealloc(reg));
       end;
 
-
-    procedure trgcpu.cleartempgen;
-      begin
-        inherited cleartempgen;
-      end;
-
-begin
-  { Only use %o and %l }
-  rg := trgcpu.create(16);
 end.
 {
   $Log$
-  Revision 1.17  2003-09-03 15:55:01  peter
+  Revision 1.18  2003-09-14 19:19:05  peter
+    * updates for new ra
+
+  Revision 1.17  2003/09/03 15:55:01  peter
     * NEWRA branch merged
 
   Revision 1.16.2.2  2003/09/02 17:49:17  peter