Bläddra i källkod

FFI/ARM: Ensure invocation of SPLIT pass for float conversions.

Mike Pall 14 år sedan
förälder
incheckning
c5164b1a7d
2 ändrade filer med 7 tillägg och 5 borttagningar
  1. 1 0
      src/lj_ir.h
  2. 6 5
      src/lj_opt_split.c

+ 1 - 0
src/lj_ir.h

@@ -354,6 +354,7 @@ typedef struct IRType1 { uint8_t irt; } IRType1;
 #endif
 
 #define irt_is64(t)		((IRT_IS64 >> irt_type(t)) & 1)
+#define irt_is64orfp(t)		(((IRT_IS64|(1u<<IRT_FLOAT))>>irt_type(t)) & 1)
 
 static LJ_AINLINE IRType itype2irt(const TValue *tv)
 {

+ 6 - 5
src/lj_opt_split.c

@@ -672,18 +672,19 @@ static int split_needsplit(jit_State *J)
   IRIns *ir, *irend;
   IRRef ref;
   for (ir = IR(REF_FIRST), irend = IR(J->cur.nins); ir < irend; ir++)
-    if (LJ_SOFTFP ? irt_is64(ir->t) : irt_isint64(ir->t))
+    if (LJ_SOFTFP ? irt_is64orfp(ir->t) : irt_isint64(ir->t))
       return 1;
   if (LJ_SOFTFP) {
     for (ref = J->chain[IR_SLOAD]; ref; ref = IR(ref)->prev)
       if ((IR(ref)->op2 & IRSLOAD_CONVERT))
 	return 1;
   }
-  for (ref = J->chain[IR_CONV]; ref; ref = IR(ref)->prev)
-    if ((LJ_SOFTFP && (IR(ref)->op2 & IRCONV_SRCMASK) == IRT_NUM) ||
-	(IR(ref)->op2 & IRCONV_SRCMASK) == IRT_I64 ||
-	(IR(ref)->op2 & IRCONV_SRCMASK) == IRT_U64)
+  for (ref = J->chain[IR_CONV]; ref; ref = IR(ref)->prev) {
+    IRType st = (IR(ref)->op2 & IRCONV_SRCMASK);
+    if ((LJ_SOFTFP && (st == IRT_NUM || st == IRT_FLOAT)) ||
+	st == IRT_I64 || st == IRT_U64)
       return 1;
+  }
   return 0;  /* Nope. */
 }
 #endif