From 41738e371a615d0e06b6a28c15e416652181c823 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Sun, 2 Dec 2012 21:22:00 +0100 Subject: [PATCH] ARM: Fix code generation for integer math.min/math.max. --- src/lj_asm_arm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h index 5a628b3b..3147ae39 100644 --- a/src/lj_asm_arm.h +++ b/src/lj_asm_arm.h @@ -1642,13 +1642,13 @@ static void asm_intmin_max(ASMState *as, IRIns *ir, int cc) kcmp = 0; right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); } - if (dest != right) { + if (kmov || dest != right) { emit_dm(as, ARMF_CC(ARMI_MOV, cc)^kmov, dest, right); cc ^= 1; /* Must use opposite conditions for paired moves. */ } else { cc ^= (CC_LT^CC_GT); /* Otherwise may swap CC_LT <-> CC_GT. */ } - if (dest != left) emit_dm(as, ARMF_CC(ARMI_MOV, cc)^kmov, dest, left); + if (dest != left) emit_dm(as, ARMF_CC(ARMI_MOV, cc), dest, left); emit_nm(as, ARMI_CMP^kcmp, left, right); } -- 2.11.4.GIT