diff options
Diffstat (limited to 'src/lj_ir.c')
-rw-r--r-- | src/lj_ir.c | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/lj_ir.c b/src/lj_ir.c index 1d57938e..721cfd0f 100644 --- a/src/lj_ir.c +++ b/src/lj_ir.c | |||
@@ -426,32 +426,6 @@ TRef LJ_FASTCALL lj_ir_tostr(jit_State *J, TRef tr) | |||
426 | return tr; | 426 | return tr; |
427 | } | 427 | } |
428 | 428 | ||
429 | /* Convert from number or string to bitop operand (overflow wrapped). */ | ||
430 | TRef LJ_FASTCALL lj_ir_tobit(jit_State *J, TRef tr) | ||
431 | { | ||
432 | if (!tref_isinteger(tr)) { | ||
433 | if (tref_isstr(tr)) | ||
434 | tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0); | ||
435 | else if (!tref_isnum(tr)) | ||
436 | lj_trace_err(J, LJ_TRERR_BADTYPE); | ||
437 | tr = emitir(IRTI(IR_TOBIT), tr, lj_ir_knum_tobit(J)); | ||
438 | } | ||
439 | return tr; | ||
440 | } | ||
441 | |||
442 | /* Convert from number or string to integer (overflow undefined). */ | ||
443 | TRef LJ_FASTCALL lj_ir_toint(jit_State *J, TRef tr) | ||
444 | { | ||
445 | if (!tref_isinteger(tr)) { | ||
446 | if (tref_isstr(tr)) | ||
447 | tr = emitir(IRTG(IR_STRTO, IRT_NUM), tr, 0); | ||
448 | else if (!tref_isnum(tr)) | ||
449 | lj_trace_err(J, LJ_TRERR_BADTYPE); | ||
450 | tr = emitir(IRTI(IR_CONV), tr, IRCONV_INT_NUM|IRCONV_ANY); | ||
451 | } | ||
452 | return tr; | ||
453 | } | ||
454 | |||
455 | /* -- Miscellaneous IR ops ------------------------------------------------ */ | 429 | /* -- Miscellaneous IR ops ------------------------------------------------ */ |
456 | 430 | ||
457 | /* Evaluate numeric comparison. */ | 431 | /* Evaluate numeric comparison. */ |