Browse Source

* fixed csdebug

peter 21 years ago
parent
commit
39b4e0398a
3 changed files with 35 additions and 19 deletions
  1. 11 4
      compiler/i386/csopt386.pas
  2. 19 13
      compiler/i386/daopt386.pas
  3. 5 2
      compiler/i386/popt386.pas

+ 11 - 4
compiler/i386/csopt386.pas

@@ -40,7 +40,11 @@ function RegSizesOK(oldReg,newReg: tsuperregister; p: taicpu): boolean;
 implementation
 implementation
 
 
 uses
 uses
+{$ifdef csdebug}
+  cutils,
+{$else}
   {$ifdef replaceregdebug}cutils,{$endif}
   {$ifdef replaceregdebug}cutils,{$endif}
+{$endif}
   globtype, verbose, procinfo, globals, daopt386, rgobj, rropt386;
   globtype, verbose, procinfo, globals, daopt386, rgobj, rropt386;
 
 
 {
 {
@@ -1692,7 +1696,7 @@ begin
                               begin
                               begin
 {$ifdef csdebug}
 {$ifdef csdebug}
                                hp5 := tai_comment.Create(strpnew(
                                hp5 := tai_comment.Create(strpnew(
-                                 'cse checking '+std_reg2str[getsupreg(taicpu(p).oper[1]^.reg)])));
+                                 'cse checking '+std_regname(taicpu(p).oper[1]^.reg)));
                                insertLLItem(asml,p,p.next,hp5);
                                insertLLItem(asml,p,p.next,hp5);
 {$endif csdebug}
 {$endif csdebug}
                                if CheckSequence(p,prevSeq,getsupreg(taicpu(p).oper[1]^.reg), Cnt, reginfo, findPrevSeqs) and
                                if CheckSequence(p,prevSeq,getsupreg(taicpu(p).oper[1]^.reg), Cnt, reginfo, findPrevSeqs) and
@@ -1736,8 +1740,8 @@ begin
                                    for regcounter := RS_EAX To RS_EDI do
                                    for regcounter := RS_EAX To RS_EDI do
                                      if (regcounter in reginfo.RegsLoadedforRef) then
                                      if (regcounter in reginfo.RegsLoadedforRef) then
                                        begin
                                        begin
-                                         hp5 := tai_comment.Create(strpnew('New: '+std_reg2str[regcounter]+', Old: '+
-                                           std_reg2str[reginfo.new2oldreg[regcounter]])));
+                                         hp5 := tai_comment.Create(strpnew('New: '+std_regname(newreg(R_INTREGISTER,regcounter,R_SUBNONE))+', Old: '+
+                                           std_regname(newreg(R_INTREGISTER,reginfo.new2oldreg[regcounter],R_SUBNONE))));
                                          InsertLLItem(asml, tai(hp2.previous), hp2, hp5);
                                          InsertLLItem(asml, tai(hp2.previous), hp2, hp5);
                                        end;
                                        end;
 {$EndIf CSDebug}
 {$EndIf CSDebug}
@@ -2056,7 +2060,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.55  2003-12-14 14:18:59  peter
+  Revision 1.56  2003-12-14 22:42:14  peter
+    * fixed csdebug
+
+  Revision 1.55  2003/12/14 14:18:59  peter
     * optimizer works again with 1.0.x
     * optimizer works again with 1.0.x
     * fixed wrong loop in FindRegWithConst
     * fixed wrong loop in FindRegWithConst
 
 

+ 19 - 13
compiler/i386/daopt386.pas

@@ -247,6 +247,9 @@ var
 Implementation
 Implementation
 
 
 Uses
 Uses
+{$ifdef csdebug}
+  cutils,
+{$endif}
   globals, systems, verbose, symconst, symsym, cgobj,
   globals, systems, verbose, symconst, symsym, cgobj,
    rgobj, procinfo;
    rgobj, procinfo;
 
 
@@ -1480,7 +1483,7 @@ begin {checks whether two taicpu instructions are equal}
                 begin
                 begin
                   include(RegInfo.RegsLoadedForRef, getsupreg(base));
                   include(RegInfo.RegsLoadedForRef, getsupreg(base));
 {$ifdef csdebug}
 {$ifdef csdebug}
-                  Writeln(std_reg2str[base], ' added');
+                  Writeln(std_regname(base), ' added');
 {$endif csdebug}
 {$endif csdebug}
                 end;
                 end;
               if (index <> NR_NO) and
               if (index <> NR_NO) and
@@ -1489,7 +1492,7 @@ begin {checks whether two taicpu instructions are equal}
                 begin
                 begin
                   include(RegInfo.RegsLoadedForRef, getsupreg(index));
                   include(RegInfo.RegsLoadedForRef, getsupreg(index));
 {$ifdef csdebug}
 {$ifdef csdebug}
-                  Writeln(std_reg2str[index], ' added');
+                  Writeln(std_regname(index), ' added');
 {$endif csdebug}
 {$endif csdebug}
                 end;
                 end;
 
 
@@ -1500,7 +1503,7 @@ begin {checks whether two taicpu instructions are equal}
               RegInfo.RegsLoadedForRef := RegInfo.RegsLoadedForRef -
               RegInfo.RegsLoadedForRef := RegInfo.RegsLoadedForRef -
                                               [getsupreg(taicpu(p2).oper[1]^.reg)];
                                               [getsupreg(taicpu(p2).oper[1]^.reg)];
 {$ifdef csdebug}
 {$ifdef csdebug}
-              Writeln(std_reg2str[getsupreg(taicpu(p2).oper[1]^.reg)], ' removed');
+              Writeln(std_regname(getsupreg(taicpu(p2).oper[1]^.reg)), ' removed');
 {$endif csdebug}
 {$endif csdebug}
             end;
             end;
           InstructionsEquivalent :=
           InstructionsEquivalent :=
@@ -1513,9 +1516,9 @@ begin {checks whether two taicpu instructions are equal}
   {$ifdef csdebug}
   {$ifdef csdebug}
         hp := tai_comment.Create(strpnew('checking if equivalent'));
         hp := tai_comment.Create(strpnew('checking if equivalent'));
         hp.previous := p2;
         hp.previous := p2;
-        hp.next := p2^.next;
-        p2^.next^.previous := hp;
-        p2^.next := hp;
+        hp.next := p2.next;
+        p2.next.previous := hp;
+        p2.next := hp;
   {$endif csdebug}
   {$endif csdebug}
         InstructionsEquivalent :=
         InstructionsEquivalent :=
           (not(assigned(taicpu(p1).oper[0])) or
           (not(assigned(taicpu(p1).oper[0])) or
@@ -1532,18 +1535,18 @@ begin {checks whether two taicpu instructions are equal}
   {$ifdef csdebug}
   {$ifdef csdebug}
         hp := tai_comment.Create(strpnew('different opcodes/format'));
         hp := tai_comment.Create(strpnew('different opcodes/format'));
         hp.previous := p2;
         hp.previous := p2;
-        hp.next := p2^.next;
-        p2^.next^.previous := hp;
-        p2^.next := hp;
+        hp.next := p2.next;
+        p2.next.previous := hp;
+        p2.next := hp;
   {$endif csdebug}
   {$endif csdebug}
         InstructionsEquivalent := False;
         InstructionsEquivalent := False;
       end;
       end;
   {$ifdef csdebug}
   {$ifdef csdebug}
     hp := tai_comment.Create(strpnew('instreq: '+tostr(byte(instructionsequivalent))));
     hp := tai_comment.Create(strpnew('instreq: '+tostr(byte(instructionsequivalent))));
     hp.previous := p2;
     hp.previous := p2;
-    hp.next := p2^.next;
-    p2^.next^.previous := hp;
-    p2^.next := hp;
+    hp.next := p2.next;
+    p2.next.previous := hp;
+    p2.next := hp;
   {$endif csdebug}
   {$endif csdebug}
 end;
 end;
 
 
@@ -2705,7 +2708,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.58  2003-12-14 14:18:59  peter
+  Revision 1.59  2003-12-14 22:42:14  peter
+    * fixed csdebug
+
+  Revision 1.58  2003/12/14 14:18:59  peter
     * optimizer works again with 1.0.x
     * optimizer works again with 1.0.x
     * fixed wrong loop in FindRegWithConst
     * fixed wrong loop in FindRegWithConst
 
 

+ 5 - 2
compiler/i386/popt386.pas

@@ -809,7 +809,7 @@ begin
                               fld/fst  mem1    (hp1)      fld/fst    mem1
                               fld/fst  mem1    (hp1)      fld/fst    mem1
                               fld      mem2    (p)        fxxx       mem2
                               fld      mem2    (p)        fxxx       mem2
                               fxxxp    st, st1 (hp2)                      }
                               fxxxp    st, st1 (hp2)                      }
-      
+
                                   begin
                                   begin
                                     case taicpu(hp2).opcode Of
                                     case taicpu(hp2).opcode Of
                                       A_FADDP: taicpu(p).opcode := A_FADD;
                                       A_FADDP: taicpu(p).opcode := A_FADD;
@@ -1996,7 +1996,10 @@ end.
 
 
 {
 {
   $Log$
   $Log$
-  Revision 1.51  2003-12-13 15:48:47  jonas
+  Revision 1.52  2003-12-14 22:42:14  peter
+    * fixed csdebug
+
+  Revision 1.51  2003/12/13 15:48:47  jonas
     * isgp32reg was being called with both tsuperregister and tregister
     * isgp32reg was being called with both tsuperregister and tregister
       parameters, so changed type to tsuperregister (fixes bug reported by
       parameters, so changed type to tsuperregister (fixes bug reported by
       Bas Steendijk)
       Bas Steendijk)