Bug fix to XMM block move optimisation

This commit is contained in:
J. Gareth "Kit" Moreton 2021-09-26 14:09:29 +00:00 committed by FPK
parent abf831c430
commit 79f60923ba
2 changed files with 16 additions and 3 deletions

View File

@ -1430,7 +1430,8 @@ Unit AoptObj;
{ same super register, different sub register? }
if SuperRegistersEqual(reg,tai_regalloc(p1).reg) and (tai_regalloc(p1).reg<>reg) then
begin
if (getsubreg(tai_regalloc(p1).reg)>getsubreg(reg)) or (getsubreg(reg)=R_SUBH) then
if (getsubreg(reg)<>R_SUBMMWHOLE) and { R_SUBMMWHOLE is below R_SUBMMX, R_SUBMMY and R_SUBMMZ }
((getsubreg(tai_regalloc(p1).reg)>getsubreg(reg)) or (getsubreg(reg)=R_SUBH)) then
internalerror(2016101501);
tai_regalloc(p1).reg:=reg;
end;

View File

@ -1036,7 +1036,7 @@ unit aoptx86;
Breakout := False;
while not Breakout and GetNextInstruction(Currentp, Currentp) and (Currentp <> hp) do
begin
case hp.typ of
case Currentp.typ of
ait_instruction:
begin
if RegInInstruction(CurrentReg, Currentp) then
@ -1052,6 +1052,12 @@ unit aoptx86;
ait_marker:
{ Don't try anything more if a marker is hit }
Exit;
ait_regalloc:
if (tai_regalloc(Currentp).ratype <> ra_dealloc) and SuperRegistersEqual(CurrentReg, tai_regalloc(Currentp).reg) then
begin
Breakout := True;
Break;
end;
else
;
end;
@ -1093,7 +1099,7 @@ unit aoptx86;
Breakout := False;
while not Breakout and GetNextInstruction(Currentp, Currentp) and (Currentp <> hp) do
begin
case hp.typ of
case Currentp.typ of
ait_instruction:
begin
if RegInInstruction(CurrentReg, Currentp) then
@ -1109,6 +1115,12 @@ unit aoptx86;
ait_marker:
{ Don't try anything more if a marker is hit }
Exit;
ait_regalloc:
if (tai_regalloc(Currentp).ratype <> ra_dealloc) and SuperRegistersEqual(CurrentReg, tai_regalloc(Currentp).reg) then
begin
Breakout := True;
Break;
end;
else
;
end;