mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-08 11:48:04 +02:00
* completed TAoptBaseCpu.RegModifiedByInstruction()
git-svn-id: trunk@29928 -
This commit is contained in:
parent
6d0f0f430d
commit
55bc5d7972
@ -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.
|
||||
|
Loading…
Reference in New Issue
Block a user