aboutsummaryrefslogtreecommitdiff
path: root/src/lj_asm_x86.h
diff options
context:
space:
mode:
authorMike Pall <mike>2013-02-22 20:39:25 +0100
committerMike Pall <mike>2013-02-23 01:19:00 +0100
commitb359ce804bb52585815fc52d7846202db4341acb (patch)
tree47ce07e6dc9403ce9e6b775c8d2f6d77360c6605 /src/lj_asm_x86.h
parentfdc0ce8debd46bdf35aaec320eef3105055e90b5 (diff)
downloadluajit-b359ce804bb52585815fc52d7846202db4341acb.tar.gz
luajit-b359ce804bb52585815fc52d7846202db4341acb.tar.bz2
luajit-b359ce804bb52585815fc52d7846202db4341acb.zip
Remove obsolete non-truncating number to integer conversions.
Diffstat (limited to 'src/lj_asm_x86.h')
-rw-r--r--src/lj_asm_x86.h7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/lj_asm_x86.h b/src/lj_asm_x86.h
index 5621b616..9dba6b70 100644
--- a/src/lj_asm_x86.h
+++ b/src/lj_asm_x86.h
@@ -726,9 +726,7 @@ static void asm_conv(ASMState *as, IRIns *ir)
726 asm_tointg(as, ir, ra_alloc1(as, lref, RSET_FPR)); 726 asm_tointg(as, ir, ra_alloc1(as, lref, RSET_FPR));
727 } else { 727 } else {
728 Reg dest = ra_dest(as, ir, RSET_GPR); 728 Reg dest = ra_dest(as, ir, RSET_GPR);
729 x86Op op = st == IRT_NUM ? 729 x86Op op = st == IRT_NUM ? XO_CVTTSD2SI : XO_CVTTSS2SI;
730 ((ir->op2 & IRCONV_TRUNC) ? XO_CVTTSD2SI : XO_CVTSD2SI) :
731 ((ir->op2 & IRCONV_TRUNC) ? XO_CVTTSS2SI : XO_CVTSS2SI);
732 if (LJ_64 ? irt_isu64(ir->t) : irt_isu32(ir->t)) { 730 if (LJ_64 ? irt_isu64(ir->t) : irt_isu32(ir->t)) {
733 /* LJ_64: For inputs >= 2^63 add -2^64, convert again. */ 731 /* LJ_64: For inputs >= 2^63 add -2^64, convert again. */
734 /* LJ_32: For inputs >= 2^31 add -2^31, convert again and add 2^31. */ 732 /* LJ_32: For inputs >= 2^31 add -2^31, convert again and add 2^31. */
@@ -850,7 +848,6 @@ static void asm_conv_int64_fp(ASMState *as, IRIns *ir)
850 Reg lo, hi; 848 Reg lo, hi;
851 lua_assert(st == IRT_NUM || st == IRT_FLOAT); 849 lua_assert(st == IRT_NUM || st == IRT_FLOAT);
852 lua_assert(dt == IRT_I64 || dt == IRT_U64); 850 lua_assert(dt == IRT_I64 || dt == IRT_U64);
853 lua_assert(((ir-1)->op2 & IRCONV_TRUNC));
854 hi = ra_dest(as, ir, RSET_GPR); 851 hi = ra_dest(as, ir, RSET_GPR);
855 lo = ra_dest(as, ir-1, rset_exclude(RSET_GPR, hi)); 852 lo = ra_dest(as, ir-1, rset_exclude(RSET_GPR, hi));
856 if (ra_used(ir-1)) emit_rmro(as, XO_MOV, lo, RID_ESP, 0); 853 if (ra_used(ir-1)) emit_rmro(as, XO_MOV, lo, RID_ESP, 0);
@@ -1457,7 +1454,7 @@ static void asm_sload(ASMState *as, IRIns *ir)
1457 lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t)); 1454 lua_assert(irt_isnum(t) || irt_isint(t) || irt_isaddr(t));
1458 if ((ir->op2 & IRSLOAD_CONVERT)) { 1455 if ((ir->op2 & IRSLOAD_CONVERT)) {
1459 t.irt = irt_isint(t) ? IRT_NUM : IRT_INT; /* Check for original type. */ 1456 t.irt = irt_isint(t) ? IRT_NUM : IRT_INT; /* Check for original type. */
1460 emit_rmro(as, irt_isint(t) ? XO_CVTSI2SD : XO_CVTSD2SI, dest, base, ofs); 1457 emit_rmro(as, irt_isint(t) ? XO_CVTSI2SD : XO_CVTTSD2SI, dest, base, ofs);
1461 } else { 1458 } else {
1462 emit_rmro(as, irt_isnum(t) ? XO_MOVSD : XO_MOV, dest, base, ofs); 1459 emit_rmro(as, irt_isnum(t) ? XO_MOVSD : XO_MOV, dest, base, ofs);
1463 } 1460 }