+ also check the register type when checking for specific integer registers in

i386's TCpuAsmOptimizer.RegReadByInstruction. Previously, the lack of this
  check could generate false reads on some other register types (e.g. mmx/xmm/
  flags, etc.), and this could worsen optimizations.

git-svn-id: trunk@35957 -
This commit is contained in:
nickysn 2017-04-26 15:25:38 +00:00
parent 618b6292ee
commit 916c09af55

View File

@ -170,7 +170,7 @@ unit aoptcpu;
A_IDIV,A_DIV,A_MUL:
begin
regReadByInstruction :=
RegInOp(reg,p.oper[0]^) or (getsupreg(reg) in [RS_EAX,RS_EDX]);
RegInOp(reg,p.oper[0]^) or ((getregtype(reg)=R_INTREGISTER) and (getsupreg(reg) in [RS_EAX,RS_EDX]));
end;
else
begin
@ -182,6 +182,8 @@ unit aoptcpu;
exit
end;
with insprop[p.opcode] do
begin
if getregtype(reg)=R_INTREGISTER then
begin
case getsupreg(reg) of
RS_EAX:
@ -233,6 +235,7 @@ unit aoptcpu;
exit
end;
end;
end;
if SuperRegistersEqual(reg,NR_DEFAULTFLAGS) then
begin
case getsubreg(reg) of