Pārlūkot izejas kodu

* fixed newra cycle for x86
* added constants for indicating source and destination operands of the
"move reg,reg" instruction to aasmcpu (and use those in rgobj)

Jonas Maebe 22 gadi atpakaļ
vecāks
revīzija
d29c96896f

+ 11 - 1
compiler/m68k/aasmcpu.pas

@@ -32,6 +32,11 @@ uses
   cpubase,cpuinfo;
 
 
+const
+  { "mov reg,reg" source operand number }
+  O_MOV_SOURCE = 0;
+  { "mov reg,reg" source operand number }
+  O_MOV_DEST = 1;
 type
 
   taicpu = class(taicpu_abstract)
@@ -409,7 +414,12 @@ implementation
 end.
 {
   $Log$
-  Revision 1.8  2003-02-19 22:00:16  daniel
+  Revision 1.9  2003-06-14 14:53:50  jonas
+    * fixed newra cycle for x86
+    * added constants for indicating source and destination operands of the
+      "move reg,reg" instruction to aasmcpu (and use those in rgobj)
+
+  Revision 1.8  2003/02/19 22:00:16  daniel
     * Code generator converted to new register notation
     - Horribily outdated todo.txt removed
 

+ 13 - 1
compiler/powerpc/aasmcpu.pas

@@ -31,6 +31,13 @@ uses
   aasmbase,globals,verbose,
   cpubase,cpuinfo;
 
+    const
+      { "mov reg,reg" source operand number }
+      O_MOV_SOURCE = 1;
+      { "mov reg,reg" source operand number }
+      O_MOV_DEST = 0;
+
+
     type
       taicpu = class(taicpu_abstract)
          constructor op_none(op : tasmop);
@@ -402,7 +409,12 @@ implementation
 end.
 {
   $Log$
-  Revision 1.6  2003-05-11 11:08:25  jonas
+  Revision 1.7  2003-06-14 14:53:50  jonas
+    * fixed newra cycle for x86
+    * added constants for indicating source and destination operands of the
+      "move reg,reg" instruction to aasmcpu (and use those in rgobj)
+
+  Revision 1.6  2003/05/11 11:08:25  jonas
     + op_reg_reg_reg_const_const (for rlwnm)
 
   Revision 1.5  2003/03/12 22:43:38  jonas

+ 7 - 2
compiler/psub.pas

@@ -659,7 +659,7 @@ implementation
         { now all the registers used are known }
         { Remove all imaginary registers from the used list.}
 {$ifdef newra}
-        procdef.usedintregisters:=rg.used_in_proc_int*ALL_INTREGISTERS-rg.saved_by_proc_int;
+        procdef.usedintregisters:=rg.used_in_proc_int*ALL_INTREGISTERS-rg.savedintbyproc;
 {$else}
         procdef.usedintregisters:=rg.used_in_proc_int;
 {$endif}
@@ -1251,7 +1251,12 @@ begin
 end.
 {
   $Log$
-  Revision 1.127  2003-06-13 21:19:31  peter
+  Revision 1.128  2003-06-14 14:53:50  jonas
+    * fixed newra cycle for x86
+    * added constants for indicating source and destination operands of the
+      "move reg,reg" instruction to aasmcpu (and use those in rgobj)
+
+  Revision 1.127  2003/06/13 21:19:31  peter
     * current_procdef removed, use current_procinfo.procdef instead
 
   Revision 1.126  2003/06/12 16:43:07  peter

+ 9 - 4
compiler/rgobj.pas

@@ -889,7 +889,7 @@ unit rgobj;
       unusedregsfpu:=usableregsfpu;
       unusedregsmm:=usableregsmm;
    {$ifdef newra}
-      saved_by_proc_int:=[];
+      savedintbyproc:=[];
       for i:=low(Tsuperregister) to high(Tsuperregister) do
         begin
           if igraph.adjlist[i]<>nil then
@@ -1492,9 +1492,9 @@ unit rgobj;
       i.moveset:=ms_worklist_moves;
       i.instruction:=instr;
       worklist_moves.insert(i);
-      ssupreg:=instr.oper[0].reg.number shr 8;
+      ssupreg:=instr.oper[O_MOV_SOURCE].reg.number shr 8;
       add_to_movelist(ssupreg,i);
-      dsupreg:=instr.oper[1].reg.number shr 8;
+      dsupreg:=instr.oper[O_MOV_DEST].reg.number shr 8;
       if ssupreg<>dsupreg then
         {Avoid adding the same move instruction twice to a single register.}
         add_to_movelist(dsupreg,i);
@@ -2453,7 +2453,12 @@ end.
 
 {
   $Log$
-  Revision 1.54  2003-06-13 21:19:31  peter
+  Revision 1.55  2003-06-14 14:53:50  jonas
+    * fixed newra cycle for x86
+    * added constants for indicating source and destination operands of the
+      "move reg,reg" instruction to aasmcpu (and use those in rgobj)
+
+  Revision 1.54  2003/06/13 21:19:31  peter
     * current_procdef removed, use current_procinfo.procdef instead
 
   Revision 1.53  2003/06/12 21:11:10  peter

+ 12 - 1
compiler/sparc/aasmcpu.pas

@@ -31,6 +31,12 @@ uses
   aasmbase,globals,verbose,
   cpubase,cpuinfo;
 
+    const
+      { "mov reg,reg" source operand number }
+      O_MOV_SOURCE = 0;
+      { "mov reg,reg" source operand number }
+      O_MOV_DEST = 1;
+
     type
       taicpu = class(taicpu_abstract)
          constructor op_none(op : tasmop);
@@ -256,7 +262,12 @@ implementation
 end.
 {
   $Log$
-  Revision 1.29  2003-06-12 16:43:07  peter
+  Revision 1.30  2003-06-14 14:53:50  jonas
+    * fixed newra cycle for x86
+    * added constants for indicating source and destination operands of the
+      "move reg,reg" instruction to aasmcpu (and use those in rgobj)
+
+  Revision 1.29  2003/06/12 16:43:07  peter
     * newra compiles for sparc
 
   Revision 1.28  2003/06/01 01:03:41  peter

+ 11 - 1
compiler/x86/aasmcpu.pas

@@ -37,6 +37,11 @@ interface
       aasmbase,aasmtai;
 
     const
+      { "mov reg,reg" source operand number }
+      O_MOV_SOURCE = 0;
+      { "mov reg,reg" source operand number }
+      O_MOV_DEST = 1;
+
     { Operand types }
       OT_NONE      = $00000000;
 
@@ -2391,7 +2396,12 @@ implementation
 end.
 {
   $Log$
-  Revision 1.5  2003-06-03 13:01:59  daniel
+  Revision 1.6  2003-06-14 14:53:50  jonas
+    * fixed newra cycle for x86
+    * added constants for indicating source and destination operands of the
+      "move reg,reg" instruction to aasmcpu (and use those in rgobj)
+
+  Revision 1.5  2003/06/03 13:01:59  daniel
     * Register allocator finished
 
   Revision 1.4  2003/05/30 23:57:08  peter

+ 10 - 5
compiler/x86/cgx86.pas

@@ -1783,7 +1783,7 @@ unit cgx86;
       r.number:=NR_EBP;
     {$ifdef newra}
       list.concat(tai_regalloc.alloc(r));
-      include(rg.saved_by_proc_int,RS_EBP);
+      include(rg.savedintbyproc,RS_EBP);
     {$endif}
       rsp.enum:=R_INTREGISTER;
       rsp.number:=NR_ESP;
@@ -1850,9 +1850,9 @@ unit cgx86;
       r.number:=NR_EDI;
       list.concat(Taicpu.op_reg(A_PUSH,S_L,r));
     {$ifdef newra}
-      include(rg.saved_by_proc_int,RS_EBX);
-      include(rg.saved_by_proc_int,RS_ESI);
-      include(rg.saved_by_proc_int,RS_EDI);
+      include(rg.savedintbyproc,RS_EBX);
+      include(rg.savedintbyproc,RS_ESI);
+      include(rg.savedintbyproc,RS_EDI);
     {$endif}
     end;
 
@@ -1935,7 +1935,12 @@ unit cgx86;
 end.
 {
   $Log$
-  Revision 1.55  2003-06-13 21:19:32  peter
+  Revision 1.56  2003-06-14 14:53:50  jonas
+    * fixed newra cycle for x86
+    * added constants for indicating source and destination operands of the
+      "move reg,reg" instruction to aasmcpu (and use those in rgobj)
+
+  Revision 1.55  2003/06/13 21:19:32  peter
     * current_procdef removed, use current_procinfo.procdef instead
 
   Revision 1.54  2003/06/12 18:31:18  peter