diff options
author | Mike Pall <mike> | 2012-12-02 21:22:00 +0100 |
---|---|---|
committer | Mike Pall <mike> | 2012-12-02 21:22:00 +0100 |
commit | 41738e371a615d0e06b6a28c15e416652181c823 (patch) | |
tree | 03cd8ccb320029900e0975d900dce8d28e426900 | |
parent | ee748dd02939aad9073b4e3f2f71eb9fddca1ade (diff) | |
download | luajit-41738e371a615d0e06b6a28c15e416652181c823.tar.gz luajit-41738e371a615d0e06b6a28c15e416652181c823.tar.bz2 luajit-41738e371a615d0e06b6a28c15e416652181c823.zip |
ARM: Fix code generation for integer math.min/math.max.
-rw-r--r-- | src/lj_asm_arm.h | 4 |
1 files 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) | |||
1642 | kcmp = 0; | 1642 | kcmp = 0; |
1643 | right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); | 1643 | right = ra_alloc1(as, ir->op2, rset_exclude(RSET_GPR, left)); |
1644 | } | 1644 | } |
1645 | if (dest != right) { | 1645 | if (kmov || dest != right) { |
1646 | emit_dm(as, ARMF_CC(ARMI_MOV, cc)^kmov, dest, right); | 1646 | emit_dm(as, ARMF_CC(ARMI_MOV, cc)^kmov, dest, right); |
1647 | cc ^= 1; /* Must use opposite conditions for paired moves. */ | 1647 | cc ^= 1; /* Must use opposite conditions for paired moves. */ |
1648 | } else { | 1648 | } else { |
1649 | cc ^= (CC_LT^CC_GT); /* Otherwise may swap CC_LT <-> CC_GT. */ | 1649 | cc ^= (CC_LT^CC_GT); /* Otherwise may swap CC_LT <-> CC_GT. */ |
1650 | } | 1650 | } |
1651 | if (dest != left) emit_dm(as, ARMF_CC(ARMI_MOV, cc)^kmov, dest, left); | 1651 | if (dest != left) emit_dm(as, ARMF_CC(ARMI_MOV, cc), dest, left); |
1652 | emit_nm(as, ARMI_CMP^kcmp, left, right); | 1652 | emit_nm(as, ARMI_CMP^kcmp, left, right); |
1653 | } | 1653 | } |
1654 | 1654 | ||