diff --git a/compiler/arm/aoptcpu.pas b/compiler/arm/aoptcpu.pas index 3a22ce71c4..23dcd07a7f 100644 --- a/compiler/arm/aoptcpu.pas +++ b/compiler/arm/aoptcpu.pas @@ -26,7 +26,7 @@ Unit aoptcpu; {$i fpcdefs.inc} { $define DEBUG_PREREGSCHEDULER} -{$define DEBUG_AOPTCPU} +{ $define DEBUG_AOPTCPU} Interface @@ -472,7 +472,9 @@ Implementation hp1 : tai; begin Result:=false; - if (MatchInstruction(movp, A_VMOV, [taicpu(p).condition], [taicpu(p).oppostfix]) or + if ((MatchInstruction(movp, A_VMOV, [taicpu(p).condition], [taicpu(p).oppostfix]) and + ((getregtype(taicpu(movp).oper[0]^.reg)=R_MMREGISTER) or (taicpu(p).opcode=A_VLDR)) + ) or (((taicpu(p).oppostfix in [PF_F64F32,PF_F64S16,PF_F64S32,PF_F64U16,PF_F64U32]) or (getsubreg(taicpu(p).oper[0]^.reg)=R_SUBFD)) and MatchInstruction(movp, A_VMOV, [taicpu(p).condition], [PF_F64])) or (((taicpu(p).oppostfix in [PF_F32F64,PF_F32S16,PF_F32S32,PF_F32U16,PF_F32U32]) or (getsubreg(taicpu(p).oper[0]^.reg)=R_SUBFS)) and MatchInstruction(movp, A_VMOV, [taicpu(p).condition], [PF_F32])) ) and @@ -519,6 +521,17 @@ Implementation IncludeRegInUsedRegs(taicpu(movp).oper[0]^.reg,UsedRegs); end; + { change + vldr reg0,[reg1] + vmov reg2,reg0 + into + ldr reg2,[reg1] + + if reg2 is an int register + } + if (taicpu(p).opcode=A_VLDR) and (getregtype(taicpu(movp).oper[0]^.reg)=R_INTREGISTER) then + taicpu(p).opcode:=A_LDR; + { finally get rid of the mov } taicpu(p).loadreg(0,taicpu(movp).oper[0]^.reg); asml.remove(movp);