DUALNUM: Add integer variant of MIN/MAX.

This commit is contained in:
Mike Pall
2011-03-11 23:28:46 +01:00
parent 889368e921
commit 7fb1075903
6 changed files with 64 additions and 7 deletions

View File

@@ -401,6 +401,18 @@ void lj_ir_kvalue(lua_State *L, TValue *tv, const IRIns *ir)
/* -- Convert IR operand types -------------------------------------------- */
/* Convert from string to number. */
TRef LJ_FASTCALL lj_ir_tonumber(jit_State *J, TRef tr)
{
if (!tref_isnumber(tr)) {
if (tref_isstr(tr))
tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0);
else
lj_trace_err(J, LJ_TRERR_BADTYPE);
}
return tr;
}
/* Convert from integer or string to number. */
TRef LJ_FASTCALL lj_ir_tonum(jit_State *J, TRef tr)
{