From 012da673a836ab0e7455b5d10e128fcf6e0ac71e Mon Sep 17 00:00:00 2001 From: masta Date: Thu, 23 Aug 2012 23:08:26 +0000 Subject: [PATCH] Use MatchInstruction in OpCmp2OpS MatchInstruction keeps the code a bit more readable and compact. git-svn-id: trunk@22226 - --- compiler/arm/aoptcpu.pas | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/compiler/arm/aoptcpu.pas b/compiler/arm/aoptcpu.pas index e97cc8435d..77d42da4d5 100644 --- a/compiler/arm/aoptcpu.pas +++ b/compiler/arm/aoptcpu.pas @@ -386,16 +386,14 @@ Implementation (taicpu(p).oper[0]^.reg = taicpu(hp1).oper[0]^.reg) and (taicpu(hp1).oper[1]^.val = 0) and GetNextInstruction(hp1, hp2) and - (tai(hp2).typ = ait_instruction) and { be careful here, following instructions could use other flags however after a jump fpc never depends on the value of flags } - (taicpu(hp2).opcode = A_B) and { All above instructions set Z and N according to the following Z := result = 0; N := result[31]; EQ = Z=1; NE = Z=0; MI = N=1; PL = N=0; } - (taicpu(hp2).condition in [C_EQ,C_NE,C_MI,C_PL]) and + MatchInstruction(hp2, A_B, [C_EQ,C_NE,C_MI,C_PL], []) and assigned(FindRegDealloc(NR_DEFAULTFLAGS,tai(hp2.Next))) then begin DebugMsg('Peephole OpCmp2OpS done', p);