Browse Source

* fixed $ifdef regalloc

peter 27 years ago
parent
commit
6af82802c2
2 changed files with 19 additions and 8 deletions
  1. 8 5
      compiler/aopt386.inc
  2. 11 3
      compiler/aopt386.pas

+ 8 - 5
compiler/aopt386.inc

@@ -24,10 +24,6 @@
 
 
 {$Define OptimizeMovs}
 {$Define OptimizeMovs}
 
 
-Type    TwoWords = Record
-            Word1, Word2: Word
-        End;
-
 Procedure ReloadOpt(AsmL: PaasmOutput);
 Procedure ReloadOpt(AsmL: PaasmOutput);
 
 
 Const MaxCh = 3;
 Const MaxCh = 3;
@@ -589,11 +585,13 @@ Function InstructionsEqual(p1, p2: Pai): Boolean;
 Begin {checks whether two Pai386 instructions are equal}
 Begin {checks whether two Pai386 instructions are equal}
   InstructionsEqual :=
   InstructionsEqual :=
     Assigned(p1) And Assigned(p2) And
     Assigned(p1) And Assigned(p2) And
+{$ifdef regalloc}
     ((((Pai(p1)^.typ = ait_regalloc) And
     ((((Pai(p1)^.typ = ait_regalloc) And
        (Pai(p2)^.typ = ait_regalloc)) Or
        (Pai(p2)^.typ = ait_regalloc)) Or
       ((Pai(p1)^.typ = ait_regdealloc) And
       ((Pai(p1)^.typ = ait_regdealloc) And
        (Pai(p2)^.typ = ait_regdealloc))) And
        (Pai(p2)^.typ = ait_regdealloc))) And
      (PaiRegAlloc(p1)^.reg = PaiRegAlloc(p2)^.reg)) Or
      (PaiRegAlloc(p1)^.reg = PaiRegAlloc(p2)^.reg)) Or
+{$endif regalloc}
     ((Pai(p1)^.typ = ait_instruction) And
     ((Pai(p1)^.typ = ait_instruction) And
      (Pai(p1)^.typ = ait_instruction) And
      (Pai(p1)^.typ = ait_instruction) And
      (Pai386(p1)^._operator = Pai386(p2)^._operator) And
      (Pai386(p1)^._operator = Pai386(p2)^._operator) And
@@ -833,7 +831,9 @@ Begin
         ait_label: DestroyAllRegs(p);
         ait_label: DestroyAllRegs(p);
         ait_labeled_instruction, ait_stabs, ait_stabn,
         ait_labeled_instruction, ait_stabs, ait_stabn,
         ait_stab_function_name:; {nothing changes}
         ait_stab_function_name:; {nothing changes}
+{$ifdef regalloc}
         ait_regalloc, ait_regdealloc:;
         ait_regalloc, ait_regdealloc:;
+{$endif regalloc}
         ait_instruction:
         ait_instruction:
           Begin
           Begin
             InstrProp := AsmInstr[Pai386(p)^._operator];
             InstrProp := AsmInstr[Pai386(p)^._operator];
@@ -1191,7 +1191,10 @@ End;
 
 
 {
 {
  $Log$
  $Log$
- Revision 1.3  1998-04-16 16:53:56  jonas
+ Revision 1.4  1998-04-21 11:30:14  peter
+   * fixed $ifdef regalloc
+
+ Revision 1.3  1998/04/16 16:53:56  jonas
  *** empty log message ***
  *** empty log message ***
 
 
  Revision 1.2  1998/04/06 22:42:32  jonas
  Revision 1.2  1998/04/06 22:42:32  jonas

+ 11 - 3
compiler/aopt386.pas

@@ -42,8 +42,11 @@ Unit aopt386;
 
 
         {ait_* types which don't result in executable code or which don't
         {ait_* types which don't result in executable code or which don't
          influence the way the program runs/behaves}
          influence the way the program runs/behaves}
-  Const SkipInstr = [ait_comment,ait_stabs, ait_stabn, ait_stab_function_name,
-                     ait_regalloc, ait_regdealloc];
+  Const SkipInstr = [ait_comment,ait_stabs, ait_stabn, ait_stab_function_name
+{$ifdef regalloc}
+                     ,ait_regalloc, ait_regdealloc
+{$endif regalloc}
+                     ];
 
 
   Type
   Type
 {$ifdef tp}
 {$ifdef tp}
@@ -1523,8 +1526,10 @@ End;
                      Continue
                      Continue
                    End;
                    End;
              End;
              End;
+{$ifdef regalloc}
            ait_regalloc: UsedRegs := UsedRegs + [PaiAlloc(p)^.Reg];
            ait_regalloc: UsedRegs := UsedRegs + [PaiAlloc(p)^.Reg];
            ait_regdealloc: UsedRegs := UsedRegs - [PaiAlloc(p)^.Reg];
            ait_regdealloc: UsedRegs := UsedRegs - [PaiAlloc(p)^.Reg];
+{$endif regalloc}
          End;
          End;
          p:=pai(p^.next);
          p:=pai(p^.next);
        end;
        end;
@@ -1609,7 +1614,10 @@ end;
 End.
 End.
 {
 {
   $Log$
   $Log$
-  Revision 1.5  1998-04-16 16:53:56  jonas
+  Revision 1.6  1998-04-21 11:30:14  peter
+    * fixed $ifdef regalloc
+
+  Revision 1.5  1998/04/16 16:53:56  jonas
   *** empty log message ***
   *** empty log message ***
 
 
   Revision 1.4  1998/04/08 19:12:28  jonas
   Revision 1.4  1998/04/08 19:12:28  jonas