Refactoring of conversion ops, part 4: use CONV instead of TOINT/TONUM.

Also narrow CONV.int.num and CONV.i64.num.
This commit is contained in:
Mike Pall
2010-12-31 03:56:30 +01:00
parent 1f26961092
commit 1716540c55
8 changed files with 89 additions and 61 deletions

View File

@@ -301,7 +301,7 @@ static void loop_unroll(jit_State *J)
/* Check all loop-carried dependencies for type instability. */
if (!irt_sametype(t, irr->t)) {
if (irt_isnum(t) && irt_isinteger(irr->t)) /* Fix int->num case. */
subst[ins] = tref_ref(emitir(IRTN(IR_TONUM), ref, 0));
subst[ins] = tref_ref(emitir(IRTN(IR_CONV), ref, IRCONV_NUM_INT));
else if (!(irt_isinteger(t) && irt_isinteger(irr->t)))
lj_trace_err(J, LJ_TRERR_TYPEINS);
}