]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
Generalize LJ_SOFTFP dependencies in lj_asm.c.
authorMike Pall <mike>
Tue, 9 Feb 2016 16:29:23 +0000 (17:29 +0100)
committerMike Pall <mike>
Tue, 9 Feb 2016 16:29:23 +0000 (17:29 +0100)
src/lj_asm.c
src/lj_asm_arm.h

index 9db950a2bd18278262266f4e3b817441f1b0ccb2..67e8d466e3f36e66d48960575df6aab2517d366a 100644 (file)
@@ -1609,16 +1609,24 @@ static void asm_ir(ASMState *as, IRIns *ir)
   case IR_ADD: asm_add(as, ir); break;
   case IR_SUB: asm_sub(as, ir); break;
   case IR_MUL: asm_mul(as, ir); break;
-  case IR_DIV: asm_div(as, ir); break;
   case IR_MOD: asm_mod(as, ir); break;
-  case IR_POW: asm_pow(as, ir); break;
   case IR_NEG: asm_neg(as, ir); break;
+#if LJ_SOFTFP
+  case IR_DIV: case IR_POW: case IR_ABS:
+  case IR_ATAN2: case IR_LDEXP: case IR_FPMATH: case IR_TOBIT:
+    lua_assert(0);  /* Unused for LJ_SOFTFP. */
+    break;
+#else
+  case IR_DIV: asm_div(as, ir); break;
+  case IR_POW: asm_pow(as, ir); break;
   case IR_ABS: asm_abs(as, ir); break;
   case IR_ATAN2: asm_atan2(as, ir); break;
   case IR_LDEXP: asm_ldexp(as, ir); break;
+  case IR_FPMATH: asm_fpmath(as, ir); break;
+  case IR_TOBIT: asm_tobit(as, ir); break;
+#endif
   case IR_MIN: asm_min(as, ir); break;
   case IR_MAX: asm_max(as, ir); break;
-  case IR_FPMATH: asm_fpmath(as, ir); break;
 
   /* Overflow-checking arithmetic ops. */
   case IR_ADDOV: asm_addov(as, ir); break;
@@ -1663,7 +1671,6 @@ static void asm_ir(ASMState *as, IRIns *ir)
   case IR_OBAR: asm_obar(as, ir); break;
 
   /* Type conversions. */
-  case IR_TOBIT: asm_tobit(as, ir); break;
   case IR_CONV: asm_conv(as, ir); break;
   case IR_TOSTR: asm_tostr(as, ir); break;
   case IR_STRTO: asm_strto(as, ir); break;
index 81843caf96ad0a1655e4d77780c446b0f8c729cb..c129dd4e031cf8cbe2b974bf588f92c34e2a113e 100644 (file)
@@ -520,8 +520,6 @@ static void asm_tobit(ASMState *as, IRIns *ir)
   emit_dn(as, ARMI_VMOV_R_S, dest, (tmp & 15));
   emit_dnm(as, ARMI_VADD_D, (tmp & 15), (left & 15), (right & 15));
 }
-#else
-#define asm_tobit(as, ir)      lua_assert(0)
 #endif
 
 static void asm_conv(ASMState *as, IRIns *ir)
@@ -1372,8 +1370,6 @@ static void asm_fpmath(ASMState *as, IRIns *ir)
   else
     asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2);
 }
-#else
-#define asm_fpmath(as, ir)     lua_assert(0)
 #endif
 
 static int asm_swapops(ASMState *as, IRRef lref, IRRef rref)
@@ -1492,13 +1488,7 @@ static void asm_mul(ASMState *as, IRIns *ir)
 #define asm_subov(as, ir)      asm_sub(as, ir)
 #define asm_mulov(as, ir)      asm_mul(as, ir)
 
-#if LJ_SOFTFP
-#define asm_div(as, ir)                lua_assert(0)
-#define asm_pow(as, ir)                lua_assert(0)
-#define asm_abs(as, ir)                lua_assert(0)
-#define asm_atan2(as, ir)      lua_assert(0)
-#define asm_ldexp(as, ir)      lua_assert(0)
-#else
+#if !LJ_SOFTFP
 #define asm_div(as, ir)                asm_fparith(as, ir, ARMI_VDIV_D)
 #define asm_pow(as, ir)                asm_callid(as, ir, IRCALL_lj_vm_powi)
 #define asm_abs(as, ir)                asm_fpunary(as, ir, ARMI_VABS_D)