Explorar o código

- get rid of MaxOps, it is redundant with max_operands
* MatchOpType with three operands is only available of max_operands>2

git-svn-id: trunk@40190 -

florian %!s(int64=6) %!d(string=hai) anos
pai
achega
9b0ff05ee8

+ 0 - 4
compiler/aarch64/aoptcpub.pas

@@ -76,10 +76,6 @@ Const
 
   MaxCh = 3;
 
-{ the maximum number of operands an instruction has }
-
-  MaxOps = 4;
-
 {Oper index of operand that contains the source (reference) with a load }
 {instruction                                                            }
 

+ 1 - 1
compiler/aoptobj.pas

@@ -828,7 +828,7 @@ Unit AoptObj;
               If (TInstr(p).oper[Count]^.typ = Top_Ref) Then
                 TmpResult := RefsEq(Ref, PInstr(p)^.oper[Count]^.ref^);
               Inc(Count);
-            Until (Count = MaxOps) or TmpResult;
+            Until (Count = max_operands) or TmpResult;
           End;
         RefInInstruction := TmpResult;
       End;

+ 5 - 13
compiler/aoptutils.pas

@@ -24,24 +24,16 @@ unit aoptutils;
 
 {$i fpcdefs.inc}
 
-{$ifdef avr}
-  {$define MAXOPTS_2}
-{$endif}
-
-{$ifdef jvm}
-  {$define MAXOPTS_2}
-{$endif}
-
   interface
 
     uses
-      aasmtai,aasmcpu;
+      cpubase,aasmtai,aasmcpu;
 
     function MatchOpType(const p : taicpu;type0: toptype) : Boolean;
     function MatchOpType(const p : taicpu;type0,type1 : toptype) : Boolean;
-{$ifndef MAXOPTS_2}
+{$if max_operands>2}
     function MatchOpType(const p : taicpu; type0,type1,type2 : toptype) : Boolean;
-{$endif ndef MAXOPTS_2}
+{$endif max_operands>2}
 
     { skips all labels and returns the next "real" instruction }
     function SkipLabels(hp: tai; var hp2: tai): boolean;
@@ -60,12 +52,12 @@ unit aoptutils;
       end;
 
 
-{$ifndef MAXOPTS_2}
+{$if max_operands>2}
     function MatchOpType(const p : taicpu; type0,type1,type2 : toptype) : Boolean;
       begin
         Result:=(p.ops=3) and (p.oper[0]^.typ=type0) and (p.oper[1]^.typ=type1) and (p.oper[2]^.typ=type1);
       end;
-{$endif ndef MAXOPTS_2}
+{$endif max_operands>2}
 
 
     { skips all labels and returns the next "real" instruction }

+ 0 - 4
compiler/arm/aoptcpub.pas

@@ -76,10 +76,6 @@ Const
 
   MaxCh = 3;
 
-{ the maximum number of operands an instruction has }
-
-  MaxOps = 4;
-
 {Oper index of operand that contains the source (reference) with a load }
 {instruction                                                            }
 

+ 0 - 4
compiler/avr/aoptcpub.pas

@@ -75,10 +75,6 @@ Const
 
   MaxCh = 2;
 
-{ the maximum number of operands an instruction has }
-
-  MaxOps = 2;
-
 {Oper index of operand that contains the source (reference) with a load }
 {instruction                                                            }
 

+ 0 - 4
compiler/i386/aoptcpub.pas

@@ -70,10 +70,6 @@ Const
 
   MaxCh = 3;
 
-{ the maximum number of operands an instruction has }
-
-  MaxOps = 3;
-
 {Oper index of operand that contains the source (reference) with a load }
 {instruction                                                            }
 

+ 0 - 4
compiler/i8086/aoptcpub.pas

@@ -70,10 +70,6 @@ Const
 
   MaxCh = 3;
 
-{ the maximum number of operands an instruction has }
-
-  MaxOps = 3;
-
 {Oper index of operand that contains the source (reference) with a load }
 {instruction                                                            }
 

+ 0 - 4
compiler/jvm/aoptcpub.pas

@@ -71,10 +71,6 @@ Const
 
   MaxCh = 2;
 
-{ the maximum number of operands an instruction has }
-
-  MaxOps = 2;
-
 {Oper index of operand that contains the source (reference) with a load }
 {instruction                                                            }
 

+ 0 - 4
compiler/m68k/aoptcpub.pas

@@ -74,10 +74,6 @@ Const
 
   MaxCh = 3;
 
-{ the maximum number of operands an instruction has }
-
-  MaxOps = 3;
-
 {Oper index of operand that contains the source (reference) with a load }
 {instruction                                                            }
 

+ 0 - 4
compiler/mips/aoptcpub.pas

@@ -69,10 +69,6 @@ Const
 
   MaxCh = 3;
 
-{ the maximum number of operands an instruction has }
-
-  MaxOps = 3;
-
 {Oper index of operand that contains the source (reference) with a load }
 {instruction                                                            }
 

+ 0 - 4
compiler/powerpc/aoptcpub.pas

@@ -71,10 +71,6 @@ Const
 
   MaxCh = 3;
 
-{ the maximum number of operands an instruction has }
-
-  MaxOps = 5;
-
 {Oper index of operand that contains the source (reference) with a load }
 {instruction                                                            }
 

+ 0 - 4
compiler/powerpc64/aoptcpub.pas

@@ -69,10 +69,6 @@ const
 
   MaxCh = 3;
 
-  { the maximum number of operands an instruction has }
-
-  MaxOps = 5;
-
   {Oper index of operand that contains the source (reference) with a load }
   {instruction                                                            }
 

+ 0 - 4
compiler/riscv32/aoptcpub.pas

@@ -71,10 +71,6 @@ Const
 
   MaxCh = 3;
 
-{ the maximum number of operands an instruction has }
-
-  MaxOps = 5;
-
 {Oper index of operand that contains the source (reference) with a load }
 {instruction                                                            }
 

+ 0 - 4
compiler/riscv64/aoptcpub.pas

@@ -69,10 +69,6 @@ const
 
   MaxCh = 3;
 
-  { the maximum number of operands an instruction has }
-
-  MaxOps = 5;
-
   {Oper index of operand that contains the source (reference) with a load }
   {instruction                                                            }
 

+ 0 - 4
compiler/sparcgen/aoptcpub.pas

@@ -70,10 +70,6 @@ Const
 
   MaxCh = 3;
 
-{ the maximum number of operands an instruction has }
-
-  MaxOps = 3;
-
 {Oper index of operand that contains the source (reference) with a load }
 {instruction                                                            }
 

+ 0 - 4
compiler/x86_64/aoptcpub.pas

@@ -70,10 +70,6 @@ Const
 
   MaxCh = 3;
 
-{ the maximum number of operands an instruction has }
-
-  MaxOps = 3;
-
 {Oper index of operand that contains the source (reference) with a load }
 {instruction                                                            }