]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
ARM: Fix IR splitting for softfp XLOAD.
authorMike Pall <mike>
Fri, 11 Nov 2011 00:07:34 +0000 (01:07 +0100)
committerMike Pall <mike>
Fri, 11 Nov 2011 00:07:34 +0000 (01:07 +0100)
src/lj_asm.c
src/lj_opt_split.c

index 9fe534160ee38326d593797d718caecc41b086d8..49fd45b4719242f5dfa7025834c55f0ca86f3948 100644 (file)
@@ -809,8 +809,10 @@ static void asm_snap_alloc(ASMState *as)
     IRRef ref = snap_ref(sn);
     if (!irref_isk(ref)) {
       asm_snap_alloc1(as, ref);
-      if (LJ_SOFTFP && (sn & SNAP_SOFTFPNUM))
+      if (LJ_SOFTFP && (sn & SNAP_SOFTFPNUM)) {
+       lua_assert(irt_type(IR(ref+1)->t) == IRT_SOFTFP);
        asm_snap_alloc1(as, ref+1);
+      }
     }
   }
 }
index 31abe419b2414f340f5719d1c7c0877c21a0b97d..913a7a0a1d877e3e395064b66ba2cb449a756e24 100644 (file)
@@ -313,13 +313,21 @@ static void split_ir(jit_State *J)
       case IR_STRTO:
        hi = split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nref, nref);
        break;
-      case IR_XLOAD:
-       hi = split_emit(J, IRT(IR_XLOAD, IRT_SOFTFP),
-                       split_ptr(J, oir, ir->op1), ir->op2);
-#if LJ_BE
+      case IR_XLOAD: {
+       IRIns inslo = *nir;  /* Save/undo the emit of the lo XLOAD. */
+       J->cur.nins--;
+       hi = split_ptr(J, oir, ir->op1);  /* Insert the hiref ADD. */
+       nref = lj_ir_nextins(J);
+       nir = IR(nref);
+       *nir = inslo;  /* Re-emit lo XLOAD immediately before hi XLOAD. */
+       hi = split_emit(J, IRT(IR_XLOAD, IRT_SOFTFP), hi, ir->op2);
+#if LJ_LE
+       ir->prev = nref;
+#else
        ir->prev = hi; hi = nref;
 #endif
        break;
+       }
       case IR_ASTORE: case IR_HSTORE: case IR_USTORE:
        split_emit(J, IRT(IR_HIOP, IRT_SOFTFP), nir->op1, hisubst[ir->op2]);
        break;