diff options
author | Mike Pall <mike> | 2011-10-22 02:02:51 +0200 |
---|---|---|
committer | Mike Pall <mike> | 2011-10-22 02:02:51 +0200 |
commit | fee957b22d063bab22b1b71221088a5d5d745e7d (patch) | |
tree | 18fd4363f3bffafbf29f943473ce8363f7b40cc3 /src/lj_asm_x86.h | |
parent | 2e5c0870bcde0fee3cb8fd31de27d30beaa9617e (diff) | |
download | luajit2-fee957b22d063bab22b1b71221088a5d5d745e7d.tar.gz |
FFI: Cleanup/fix 64 bit arithmetic in assembler backend.
Diffstat (limited to 'src/lj_asm_x86.h')
-rw-r--r-- | src/lj_asm_x86.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h index 45afdc88..6767e0c7 100644 --- a/src/lj_asm_x86.h +++ b/src/lj_asm_x86.h @@ -2160,19 +2160,25 @@ static void asm_hiop(ASMState *as, IRIns *ir) if (!usehi) return; /* Skip unused hiword op for all remaining ops. */ switch ((ir-1)->o) { case IR_ADD: - asm_intarith(as, ir, uselo ? XOg_ADC : XOg_ADD); + as->flagmcp = NULL; + as->curins--; + asm_intarith(as, ir, XOg_ADC); + asm_intarith(as, ir-1, XOg_ADD); break; case IR_SUB: - asm_intarith(as, ir, uselo ? XOg_SBB : XOg_SUB); + as->flagmcp = NULL; + as->curins--; + asm_intarith(as, ir, XOg_SBB); + asm_intarith(as, ir-1, XOg_SUB); break; case IR_NEG: { Reg dest = ra_dest(as, ir, RSET_GPR); emit_rr(as, XO_GROUP3, XOg_NEG, dest); - if (uselo) { - emit_i8(as, 0); - emit_rr(as, XO_ARITHi8, XOg_ADC, dest); - } + emit_i8(as, 0); + emit_rr(as, XO_ARITHi8, XOg_ADC, dest); ra_left(as, dest, ir->op1); + as->curins--; + asm_neg_not(as, ir-1, XOg_NEG); break; } case IR_CALLN: |