|
@@ -105,6 +105,9 @@ unit aoptbase;
|
|
{ compares reg1 and reg2 having the same type and being the same super registers
|
|
{ compares reg1 and reg2 having the same type and being the same super registers
|
|
so the register size is neglected }
|
|
so the register size is neglected }
|
|
class function SuperRegistersEqual(reg1,reg2 : TRegister) : Boolean; static; {$ifdef USEINLINE}inline;{$endif}
|
|
class function SuperRegistersEqual(reg1,reg2 : TRegister) : Boolean; static; {$ifdef USEINLINE}inline;{$endif}
|
|
|
|
+
|
|
|
|
+ { returns true if changing reg1 changes reg2 or vice versa }
|
|
|
|
+ class function RegistersInterfere(reg1,reg2 : TRegister) : Boolean; static; {$ifdef USEINLINE}inline;{$endif}
|
|
end;
|
|
end;
|
|
|
|
|
|
function labelCanBeSkipped(p: tai_label): boolean; {$ifdef USEINLINE}inline;{$endif}
|
|
function labelCanBeSkipped(p: tai_label): boolean; {$ifdef USEINLINE}inline;{$endif}
|
|
@@ -344,6 +347,16 @@ unit aoptbase;
|
|
{$endif Z80}
|
|
{$endif Z80}
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+
|
|
|
|
+ class function TAOptBase.RegistersInterfere(reg1,reg2 : TRegister) : Boolean; static; {$ifdef USEINLINE}inline;{$endif}
|
|
|
|
+ begin
|
|
|
|
+{$ifdef Z80}
|
|
|
|
+ result:=registers_interfere(reg1,reg2);
|
|
|
|
+{$else Z80}
|
|
|
|
+ result:=SuperRegistersEqual(reg1,reg2);
|
|
|
|
+{$endif Z80}
|
|
|
|
+ end;
|
|
|
|
+
|
|
{ ******************* Processor dependent stuff *************************** }
|
|
{ ******************* Processor dependent stuff *************************** }
|
|
|
|
|
|
Function TAOptBase.RegMaxSize(Reg: TRegister): TRegister;
|
|
Function TAOptBase.RegMaxSize(Reg: TRegister): TRegister;
|