From ce9e1a3419a525d024fc4f9ad5af6c261cd44f7b Mon Sep 17 00:00:00 2001 From: florian Date: Sun, 8 Sep 2019 20:53:43 +0000 Subject: [PATCH] + AArch64: FoldShiftProcess fixed git-svn-id: trunk@42963 - --- compiler/aarch64/aoptcpu.pas | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/aarch64/aoptcpu.pas b/compiler/aarch64/aoptcpu.pas index 734de5a56a..8770591440 100644 --- a/compiler/aarch64/aoptcpu.pas +++ b/compiler/aarch64/aoptcpu.pas @@ -401,10 +401,9 @@ Implementation ((taicpu(hp1).opcode<>A_SUB) or MatchOperand(taicpu(p).oper[0]^, taicpu(hp1).oper[taicpu(hp1).ops-1]^)) then begin - if taicpu(hp1).opcode in [A_TST, A_CMP, A_CMN, A_MOV] then - I2:=0 - else - I2:=1; + { for the two operand instructions, start also at the second operand as they are not always commutative + (depends on the flags tested laster on) and thus the operands cannot swapped } + I2:=1; for I:=I2 to taicpu(hp1).ops-1 do if MatchOperand(taicpu(p).oper[0]^, taicpu(hp1).oper[I]^.reg) then begin