diff options
author | Mike Pall <mike> | 2011-06-03 18:48:02 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-06-03 18:48:02 +0200 |
commit | 8c5935000d2b9bccd6c563b45c6a893f28986ca5 (patch) | |
tree | 2f530cf0b703350e355f1931679a7ed68503867e /src/lj_asm_arm.h | |
parent | eec28aa9fdf5f733a4f7d2628fc060eac66ab713 (diff) | |
download | luajit-8c5935000d2b9bccd6c563b45c6a893f28986ca5.tar.gz luajit-8c5935000d2b9bccd6c563b45c6a893f28986ca5.tar.bz2 luajit-8c5935000d2b9bccd6c563b45c6a893f28986ca5.zip |
Add narrowing of modulo operator.
Diffstat (limited to 'src/lj_asm_arm.h')
-rw-r--r-- | src/lj_asm_arm.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/lj_asm_arm.h b/src/lj_asm_arm.h index 5890b54f..74a3a927 100644 --- a/src/lj_asm_arm.h +++ b/src/lj_asm_arm.h | |||
@@ -1110,6 +1110,16 @@ static void asm_intmul(ASMState *as, IRIns *ir) | |||
1110 | if (ra_hasreg(tmp)) emit_dm(as, ARMI_MOV, tmp, right); | 1110 | if (ra_hasreg(tmp)) emit_dm(as, ARMI_MOV, tmp, right); |
1111 | } | 1111 | } |
1112 | 1112 | ||
1113 | static void asm_intmod(ASMState *as, IRIns *ir) | ||
1114 | { | ||
1115 | const CCallInfo *ci = &lj_ir_callinfo[IRCALL_lj_vm_modi]; | ||
1116 | IRRef args[2]; | ||
1117 | args[0] = ir->op1; | ||
1118 | args[1] = ir->op2; | ||
1119 | asm_setupresult(as, ir, ci); | ||
1120 | asm_gencall(as, ci, args); | ||
1121 | } | ||
1122 | |||
1113 | static void asm_bitswap(ASMState *as, IRIns *ir) | 1123 | static void asm_bitswap(ASMState *as, IRIns *ir) |
1114 | { | 1124 | { |
1115 | Reg dest = ra_dest(as, ir, RSET_GPR); | 1125 | Reg dest = ra_dest(as, ir, RSET_GPR); |
@@ -1652,6 +1662,7 @@ static void asm_ir(ASMState *as, IRIns *ir) | |||
1652 | case IR_ADD: case IR_ADDOV: asm_arithop(as, ir, ARMI_ADD); break; | 1662 | case IR_ADD: case IR_ADDOV: asm_arithop(as, ir, ARMI_ADD); break; |
1653 | case IR_SUB: case IR_SUBOV: asm_arithop(as, ir, ARMI_SUB); break; | 1663 | case IR_SUB: case IR_SUBOV: asm_arithop(as, ir, ARMI_SUB); break; |
1654 | case IR_MUL: case IR_MULOV: asm_intmul(as, ir); break; | 1664 | case IR_MUL: case IR_MULOV: asm_intmul(as, ir); break; |
1665 | case IR_MOD: asm_intmod(as, ir); break; | ||
1655 | 1666 | ||
1656 | case IR_NEG: asm_intneg(as, ir, ARMI_RSB); break; | 1667 | case IR_NEG: asm_intneg(as, ir, ARMI_RSB); break; |
1657 | 1668 | ||
@@ -1659,7 +1670,7 @@ static void asm_ir(ASMState *as, IRIns *ir) | |||
1659 | case IR_MAX: asm_intmin_max(as, ir, CC_LT); break; | 1670 | case IR_MAX: asm_intmin_max(as, ir, CC_LT); break; |
1660 | 1671 | ||
1661 | case IR_FPMATH: case IR_ATAN2: case IR_LDEXP: | 1672 | case IR_FPMATH: case IR_ATAN2: case IR_LDEXP: |
1662 | case IR_DIV: case IR_MOD: case IR_POW: case IR_ABS: case IR_TOBIT: | 1673 | case IR_DIV: case IR_POW: case IR_ABS: case IR_TOBIT: |
1663 | lua_assert(0); /* Unused for LJ_SOFTFP. */ | 1674 | lua_assert(0); /* Unused for LJ_SOFTFP. */ |
1664 | break; | 1675 | break; |
1665 | 1676 | ||