From 1027018b2135caf45057c3d3b3da03ffb0c6add3 Mon Sep 17 00:00:00 2001 From: Mike Pall Date: Wed, 2 Feb 2011 21:33:11 +0100 Subject: [PATCH] Rename IR_POWI to IR_POW. --- src/lj_asm.c | 8 ++++---- src/lj_ir.h | 2 +- src/lj_opt_fold.c | 16 ++++++++-------- src/lj_opt_narrow.c | 2 +- src/lj_opt_split.c | 2 +- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/lj_asm.c b/src/lj_asm.c index 27c9ac31..8864c9a3 100644 --- a/src/lj_asm.c +++ b/src/lj_asm.c @@ -2749,7 +2749,7 @@ static void asm_fpmath(ASMState *as, IRIns *ir) } } -static void asm_powi(ASMState *as, IRIns *ir) +static void asm_fppowi(ASMState *as, IRIns *ir) { /* The modified regs must match with the *.dasc implementation. */ RegSet drop = RSET_RANGE(RID_XMM0, RID_XMM1+1)|RID2RSET(RID_EAX); @@ -4020,14 +4020,14 @@ static void asm_ir(ASMState *as, IRIns *ir) case IR_FPMATH: case IR_ATAN2: case IR_LDEXP: asm_fpmath(as, ir); break; - case IR_POWI: + case IR_POW: #if LJ_64 && LJ_HASFFI if (!irt_isnum(ir->t)) asm_arith64(as, ir, irt_isi64(ir->t) ? IRCALL_lj_carith_powi64 : IRCALL_lj_carith_powu64); else #endif - asm_powi(as, ir); + asm_fppowi(as, ir); break; /* Overflow-checking arithmetic ops. Note: don't use LEA here! */ @@ -4183,7 +4183,7 @@ static void asm_setup_regsp(ASMState *as, GCtrace *T) if (inloop) as->modset = RSET_SCRATCH; break; - case IR_POWI: + case IR_POW: if (irt_isnum(ir->t)) { ir->prev = REGSP_HINT(RID_XMM0); if (inloop) diff --git a/src/lj_ir.h b/src/lj_ir.h index d2ad87f3..dfafc5db 100644 --- a/src/lj_ir.h +++ b/src/lj_ir.h @@ -67,7 +67,7 @@ _(MUL, C , ref, ref) \ _(DIV, N , ref, ref) \ _(MOD, N , ref, ref) \ - _(POWI, N , ref, ref) \ + _(POW, N , ref, ref) \ _(NEG, N , ref, ref) \ \ _(ABS, N , ref, ref) \ diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c index 93fb782c..c3b0a082 100644 --- a/src/lj_opt_fold.c +++ b/src/lj_opt_fold.c @@ -184,12 +184,12 @@ LJFOLDF(kfold_fpmath) return lj_ir_knum(J, y); } -LJFOLD(POWI KNUM KINT) -LJFOLDF(kfold_powi) +LJFOLD(POW KNUM KINT) +LJFOLDF(kfold_numpow) { lua_Number a = knumleft; lua_Number b = cast_num(fright->i); - lua_Number y = lj_vm_foldarith(a, b, IR_POWI - IR_ADD); + lua_Number y = lj_vm_foldarith(a, b, IR_POW - IR_ADD); return lj_ir_knum(J, y); } @@ -326,7 +326,7 @@ LJFOLDF(kfold_int64arith) LJFOLD(DIV KINT64 KINT64) LJFOLD(MOD KINT64 KINT64) -LJFOLD(POWI KINT64 KINT64) +LJFOLD(POW KINT64 KINT64) LJFOLDF(kfold_int64arith2) { #if LJ_HASFFI @@ -784,8 +784,8 @@ LJFOLDF(simplify_nummuldiv_negneg) return RETRYFOLD; } -LJFOLD(POWI any KINT) -LJFOLDF(simplify_powi_xk) +LJFOLD(POW any KINT) +LJFOLDF(simplify_numpow_xk) { int32_t k = fright->i; TRef ref = fins->op1; @@ -814,8 +814,8 @@ LJFOLDF(simplify_powi_xk) return ref; } -LJFOLD(POWI KNUM any) -LJFOLDF(simplify_powi_kx) +LJFOLD(POW KNUM any) +LJFOLDF(simplify_numpow_kx) { lua_Number n = knumleft; if (n == 2.0) { /* 2.0 ^ i ==> ldexp(1.0, tonum(i)) */ diff --git a/src/lj_opt_narrow.c b/src/lj_opt_narrow.c index 837ca015..71062493 100644 --- a/src/lj_opt_narrow.c +++ b/src/lj_opt_narrow.c @@ -428,7 +428,7 @@ TRef lj_opt_narrow_pow(jit_State *J, TRef rb, TRef rc, TValue *vc) tmp = emitir(IRTI(IR_ADD), rc, lj_ir_kint(J, 65536-2147483647-1)); emitir(IRTGI(IR_LE), tmp, lj_ir_kint(J, 2*65536-2147483647-1)); } - return emitir(IRTN(IR_POWI), rb, rc); + return emitir(IRTN(IR_POW), rb, rc); } /* FOLD covers most cases, but some are easier to do here. */ if (tref_isk(rb) && tvispone(ir_knum(IR(tref_ref(rb))))) diff --git a/src/lj_opt_split.c b/src/lj_opt_split.c index f4339e85..f53616b3 100644 --- a/src/lj_opt_split.c +++ b/src/lj_opt_split.c @@ -207,7 +207,7 @@ static void split_ir(jit_State *J) irt_isi64(ir->t) ? IRCALL_lj_carith_modi64 : IRCALL_lj_carith_modu64); break; - case IR_POWI: + case IR_POW: hi = split_call64(J, hisubst, oir, ir, irt_isi64(ir->t) ? IRCALL_lj_carith_powi64 : IRCALL_lj_carith_powu64);