* improved (V)MOVA*(V)MOVA*2(V)MOVA* 2 optimization

git-svn-id: trunk@47079 -
This commit is contained in:
florian 2020-10-10 21:08:14 +00:00
parent a8b387a166
commit f284a6eda9

View File

@ -1429,7 +1429,6 @@ unit aoptx86;
else if GetNextInstruction(p,hp1) then
begin
if MatchInstruction(hp1,[taicpu(p).opcode],[S_NO]) and
MatchOpType(taicpu(hp1),top_reg,top_reg) and
MatchOperand(taicpu(p).oper[1]^,taicpu(hp1).oper[0]^) then
begin
{ vmova* reg1,reg2
@ -1439,7 +1438,8 @@ unit aoptx86;
vmova* reg1,reg3 }
TransferUsedRegs(TmpUsedRegs);
UpdateUsedRegs(TmpUsedRegs, tai(p.next));
if not(RegUsedAfterInstruction(taicpu(p).oper[1]^.reg,hp1,TmpUsedRegs)) then
if MatchOpType(taicpu(hp1),top_reg,top_reg) and
not(RegUsedAfterInstruction(taicpu(p).oper[1]^.reg,hp1,TmpUsedRegs)) then
begin
DebugMsg(SPeepholeOptimization + '(V)MOVA*(V)MOVA*2(V)MOVA* 1',p);
taicpu(p).loadoper(1,taicpu(hp1).oper[1]^);
@ -1448,11 +1448,14 @@ unit aoptx86;
exit;
end
{ special case:
vmova* reg1,reg2
vmova* reg2,reg1
vmova* reg1,<op>
vmova* <op>,reg1
=>
vmova* reg1,reg2 }
else if MatchOperand(taicpu(p).oper[0]^,taicpu(hp1).oper[1]^) then
vmova* reg1,<op> }
else if MatchOperand(taicpu(p).oper[0]^,taicpu(hp1).oper[1]^) and
((taicpu(p).oper[0]^.typ<>top_ref) or
(not(vol_read in taicpu(p).oper[0]^.ref^.volatility))
) then
begin
DebugMsg(SPeepholeOptimization + '(V)MOVA*(V)MOVA*2(V)MOVA* 2',p);
RemoveInstruction(hp1);