Browse Source

* fix warnings when compiler is compiled for CPU with max_operands=1

Nikolay Nikolov 1 month ago
parent
commit
afe762684e
3 changed files with 14 additions and 0 deletions
  1. 4 0
      compiler/aoptutils.pas
  2. 4 0
      compiler/cgobj.pas
  3. 6 0
      compiler/rgobj.pas

+ 4 - 0
compiler/aoptutils.pas

@@ -30,7 +30,9 @@ unit aoptutils;
       cpubase,aasmtai,aasmcpu;
 
     function MatchOpType(const p : taicpu;type0: toptype) : Boolean;
+{$if max_operands>1}
     function MatchOpType(const p : taicpu;type0,type1 : toptype) : Boolean;
+{$endif max_operands>1}
 {$if max_operands>2}
     function MatchOpType(const p : taicpu; type0,type1,type2 : toptype) : Boolean;
 {$endif max_operands>2}
@@ -56,10 +58,12 @@ unit aoptutils;
       end;
 
 
+{$if max_operands>1}
     function MatchOpType(const p : taicpu; type0,type1 : toptype) : Boolean; inline;
       begin
         Result:=(p.ops=2) and (p.oper[0]^.typ=type0) and (p.oper[1]^.typ=type1);
       end;
+{$endif max_operands>1}
 
 
 {$if max_operands>2}

+ 4 - 0
compiler/cgobj.pas

@@ -104,7 +104,9 @@ unit cgobj;
 {$endif cpu8bitalu}
 
           procedure add_reg_instruction(instr:Tai;r:tregister);virtual;
+{$if max_operands>1}
           procedure add_move_instruction(instr:Taicpu);virtual;
+{$endif max_operands>1}
 
           function  uses_registers(rt:Tregistertype):boolean;virtual;
           {# Get a specific register.}
@@ -879,6 +881,7 @@ implementation
       end;
 
 
+{$if max_operands>1}
     procedure tcg.add_move_instruction(instr:Taicpu);
       var
         rt : tregistertype;
@@ -889,6 +892,7 @@ implementation
         else
           internalerror(200310095);
       end;
+{$endif max_operands>1}
 
 
     procedure tcg.set_regalloc_live_range_direction(dir: TRADirection);

+ 6 - 0
compiler/rgobj.pas

@@ -188,7 +188,9 @@ unit rgobj;
         procedure dealloccpuregisters(list:TAsmList;const r:Tcpuregisterset);virtual;
         function uses_registers:boolean;virtual;
         procedure add_reg_instruction(instr:Tai;r:tregister;aweight:longint);
+{$if max_operands>1}
         procedure add_move_instruction(instr:Taicpu);
+{$endif max_operands>1}
         { Do the register allocation.}
         procedure do_register_allocation(list:TAsmList;headertai:tai);virtual;
         { Adds an interference edge.
@@ -929,6 +931,7 @@ unit rgobj;
       end;
 
 
+{$if max_operands>1}
     procedure trgobj.add_move_instruction(instr:Taicpu);
 
     {This procedure notifies a certain as a move instruction so the
@@ -967,6 +970,7 @@ unit rgobj;
       i.x:=ssupreg;
       i.y:=dsupreg;
     end;
+{$endif max_operands>1}
 
     function trgobj.move_related(n:Tsuperregister):boolean;
 
@@ -2835,6 +2839,7 @@ unit rgobj;
         if not spilled then
           exit;
 
+{$if max_operands>1}
         { Check if the instruction is "OP reg1,reg2" and reg1 is coalesced with reg2 }
         if (spregs.spillreginfocount=1) and (instr.ops=2) and
           (instr.oper[0]^.typ=top_reg) and (instr.oper[1]^.typ=top_reg) and
@@ -2848,6 +2853,7 @@ unit rgobj;
             if instr.is_same_reg_move(regtype) then
               exit;
           end;
+{$endif max_operands>1}
 
 {$if defined(x86) or defined(mips) or defined(sparcgen) or defined(arm) or defined(m68k)}
         { Try replacing the register with the spilltemp. This is useful only