From 4c0dac48649acc8b85729a7b6689661cd786d781 Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 22 Nov 2020 21:20:51 +0000 Subject: [PATCH] + Aarch64: implemented FMovFMov2FMov, not yet used git-svn-id: trunk@47534 - --- compiler/aarch64/aoptcpu.pas | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/compiler/aarch64/aoptcpu.pas b/compiler/aarch64/aoptcpu.pas index 29611f4be7..e682bbdda7 100644 --- a/compiler/aarch64/aoptcpu.pas +++ b/compiler/aarch64/aoptcpu.pas @@ -538,6 +538,27 @@ Implementation DebugMsg(SPeepholeOptimization + 'FMovFMov2FMov done', p); Result:=true; end; + { not enabled as apparently not happening + if MatchOpType(taicpu(p),top_reg,top_reg) and + GetNextInstructionUsingReg(p,hp1,taicpu(p).oper[0]^.reg) and + MatchInstruction(hp1, [A_FSUB,A_FADD,A_FNEG,A_FMUL,A_FSQRT,A_FDIV,A_FABS], [PF_None]) and + (MatchOperand(taicpu(p).oper[0]^,taicpu(hp1).oper[1]^) or + ((taicpu(hp1).ops=3) and MatchOperand(taicpu(p).oper[0]^,taicpu(hp1).oper[2]^)) + ) and + RegEndofLife(taicpu(p).oper[0]^.reg,taicpu(hp1)) and + not(RegUsedBetween(taicpu(p).oper[0]^.reg,p,hp1)) then + begin + DebugMsg(SPeepholeOptimization + 'FMovFOp2FOp done', hp1); + AllocRegBetween(taicpu(hp1).oper[1]^.reg,p,hp1,UsedRegs); + if MatchOperand(taicpu(p).oper[0]^,taicpu(hp1).oper[1]^) then + taicpu(hp1).oper[1]^.reg:=taicpu(p).oper[1]^.reg; + if (taicpu(hp1).ops=3) and MatchOperand(taicpu(p).oper[0]^,taicpu(hp1).oper[2]^) then + taicpu(hp1).oper[2]^.reg:=taicpu(p).oper[1]^.reg; + RemoveCurrentP(p); + Result:=true; + exit; + end; + } end;