mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 21:49:18 +02:00
+ VPXorVMov2Mov optimization
This commit is contained in:
parent
6c065e69fd
commit
d2c2ddb337
@ -7160,19 +7160,40 @@ unit aoptx86;
|
|||||||
}
|
}
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if MatchOperand(taicpu(p).oper[0]^,taicpu(p).oper[1]^,taicpu(p).oper[2]^) and
|
if MatchOperand(taicpu(p).oper[0]^,taicpu(p).oper[1]^,taicpu(p).oper[2]^) and
|
||||||
MatchOpType(taicpu(p),top_reg,top_reg,top_reg) and
|
MatchOpType(taicpu(p),top_reg,top_reg,top_reg) then
|
||||||
GetNextInstructionUsingReg(p,hp1,taicpu(p).oper[0]^.reg) and
|
|
||||||
MatchInstruction(hp1,taicpu(p).opcode,[taicpu(p).opsize]) and
|
|
||||||
MatchOperand(taicpu(p).oper[0]^,taicpu(hp1).oper[0]^) and
|
|
||||||
MatchOperand(taicpu(hp1).oper[0]^,taicpu(hp1).oper[1]^,taicpu(hp1).oper[2]^) then
|
|
||||||
begin
|
begin
|
||||||
DebugMsg(SPeepholeOptimization + 'VPXorVPXor2PXor done',hp1);
|
if GetNextInstructionUsingReg(p,hp1,taicpu(p).oper[0]^.reg) and
|
||||||
RemoveInstruction(hp1);
|
MatchInstruction(hp1,taicpu(p).opcode,[taicpu(p).opsize]) and
|
||||||
Result:=true;
|
MatchOperand(taicpu(p).oper[0]^,taicpu(hp1).oper[0]^) and
|
||||||
Exit;
|
MatchOperand(taicpu(hp1).oper[0]^,taicpu(hp1).oper[1]^,taicpu(hp1).oper[2]^) then
|
||||||
end
|
begin
|
||||||
else
|
DebugMsg(SPeepholeOptimization + 'VPXorVPXor2PXor done',hp1);
|
||||||
Result:=OptPass1VOP(p);
|
RemoveInstruction(hp1);
|
||||||
|
Result:=true;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
{$ifdef x86_64}
|
||||||
|
if GetNextInstruction(p,hp1) and
|
||||||
|
MatchInstruction(hp1,A_VMOVSD,[]) and
|
||||||
|
MatchOperand(taicpu(p).oper[2]^,taicpu(hp1).oper[0]^) and
|
||||||
|
MatchOpType(taicpu(hp1),top_reg,top_ref) then
|
||||||
|
begin
|
||||||
|
TransferUsedRegs(TmpUsedRegs);
|
||||||
|
UpdateUsedRegs(TmpUsedRegs, tai(p.next));
|
||||||
|
if not(RegUsedAfterInstruction(taicpu(hp1).oper[0]^.reg,hp1,TmpUsedRegs)) then
|
||||||
|
begin
|
||||||
|
taicpu(hp1).loadconst(0,0);
|
||||||
|
taicpu(hp1).opcode:=A_MOV;
|
||||||
|
taicpu(hp1).opsize:=S_Q;
|
||||||
|
DebugMsg(SPeepholeOptimization + 'VPXorVMov2Mov done',p);
|
||||||
|
RemoveCurrentP(p);
|
||||||
|
result:=true;
|
||||||
|
Exit;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
{$endif x86_64}
|
||||||
|
end;
|
||||||
|
Result:=OptPass1VOP(p);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user