* completed TAoptBaseCpu.RegModifiedByInstruction()

git-svn-id: trunk@29928 -
This commit is contained in:
Jonas Maebe 2015-02-23 22:53:23 +00:00
parent 6d0f0f430d
commit 55bc5d7972

View File

@ -118,17 +118,35 @@ Implementation
End;
function TAoptBaseCpu.RegModifiedByInstruction(Reg: TRegister; p1: tai): boolean;
function TAoptBaseCpu.RegModifiedByInstruction(reg: tregister; p1: tai): boolean;
var
i : Longint;
i: longint;
preg: tregister;
begin
result:=false;
for i:=0 to taicpu(p1).ops-1 do
if (taicpu(p1).oper[i]^.typ=top_reg) and (taicpu(p1).oper[i]^.reg=Reg) and (taicpu(p1).spilling_get_operation_type(i) in [operand_write,operand_readwrite]) then
begin
result:=true;
exit;
end;
case taicpu(p1).oper[i]^.typ of
top_reg:
begin
preg:=taicpu(p1).oper[i]^.reg;
if (getregtype(preg)=getregtype(reg)) and
(getsupreg(preg)=getsupreg(reg)) and
(taicpu(p1).spilling_get_operation_type(i) in [operand_write,operand_readwrite]) then
begin
result:=true;
exit;
end;
end;
top_ref:
begin
if (taicpu(p1).oper[i]^.ref^.addressmode<>am_offset) and
(reg=taicpu(p1).oper[i]^.ref^.base) then
begin
result:=true;
exit
end;
end;
end;
end;
End.