aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Pall <mike>2011-02-06 00:45:39 +0100
committerMike Pall <mike>2011-02-06 00:45:39 +0100
commit4c74f704644c2f843cb304aba0c901723097ff14 (patch)
treef2f9ce13ba3d837ac00ecce3e460752308e8e674 /src
parent26bb0fe24b96f00d4df59fe0af464e22a2130958 (diff)
downloadluajit-4c74f704644c2f843cb304aba0c901723097ff14.tar.gz
luajit-4c74f704644c2f843cb304aba0c901723097ff14.tar.bz2
luajit-4c74f704644c2f843cb304aba0c901723097ff14.zip
Strength-reduce 32 to 64 bit widening for XLOAD U8/U16 inputs.
Diffstat (limited to 'src')
-rw-r--r--src/lj_opt_fold.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/lj_opt_fold.c b/src/lj_opt_fold.c
index 1172f4fc..f4872046 100644
--- a/src/lj_opt_fold.c
+++ b/src/lj_opt_fold.c
@@ -917,6 +917,8 @@ LJFOLDF(simplify_conv_sext)
917 if (!(fins->op2 & IRCONV_SEXT)) 917 if (!(fins->op2 & IRCONV_SEXT))
918 return NEXTFOLD; 918 return NEXTFOLD;
919 PHIBARRIER(fleft); 919 PHIBARRIER(fleft);
920 if (fleft->o == IR_XLOAD && (irt_isu8(fleft->t) || irt_isu16(fleft->t)))
921 goto ok_reduce;
920 if (fleft->o == IR_ADD && irref_isk(fleft->op2)) { 922 if (fleft->o == IR_ADD && irref_isk(fleft->op2)) {
921 ofs = (int64_t)IR(fleft->op2)->i; 923 ofs = (int64_t)IR(fleft->op2)->i;
922 ref = fleft->op1; 924 ref = fleft->op1;
@@ -926,6 +928,7 @@ LJFOLDF(simplify_conv_sext)
926 IRRef lo = J->scev.dir ? J->scev.start : J->scev.stop; 928 IRRef lo = J->scev.dir ? J->scev.start : J->scev.stop;
927 lua_assert(irt_isint(J->scev.t)); 929 lua_assert(irt_isint(J->scev.t));
928 if (lo && IR(lo)->i + ofs >= 0) { 930 if (lo && IR(lo)->i + ofs >= 0) {
931 ok_reduce:
929#if LJ_TARGET_X64 932#if LJ_TARGET_X64
930 /* Eliminate widening. All 32 bit ops do an implicit zero-extension. */ 933 /* Eliminate widening. All 32 bit ops do an implicit zero-extension. */
931 return LEFTFOLD; 934 return LEFTFOLD;