]> git.ipfire.org Git - thirdparty/LuaJIT.git/commitdiff
MIPS: Compile math.sqrt() to sqrt.d instruction.
authorMike Pall <mike>
Mon, 15 Oct 2012 19:28:10 +0000 (21:28 +0200)
committerMike Pall <mike>
Mon, 15 Oct 2012 19:28:10 +0000 (21:28 +0200)
src/lj_asm_mips.h
src/lj_target_mips.h

index 37160c05517ee6b59bbbc4832c861406692910f1..5d4115a95b5688f885202061b56f30b141c793aa 100644 (file)
@@ -1827,6 +1827,8 @@ static void asm_ir(ASMState *as, IRIns *ir)
       break;
     if (ir->op2 <= IRFPM_TRUNC)
       asm_callround(as, ir, IRCALL_lj_vm_floor + ir->op2);
+    else if (ir->op2 == IRFPM_SQRT)
+      asm_fpunary(as, ir, MIPSI_SQRT_D);
     else
       asm_callid(as, ir, IRCALL_lj_vm_floor + ir->op2);
     break;
index 1b7727d01097e513785ca2b4e1c5f797f3ffc953..4d079eaa1f27542cb32cda20b0321aff82ec5ca9 100644 (file)
@@ -223,6 +223,7 @@ typedef enum MIPSIns {
   MIPSI_SUB_D = 0x46200001,
   MIPSI_MUL_D = 0x46200002,
   MIPSI_DIV_D = 0x46200003,
+  MIPSI_SQRT_D = 0x46200004,
 
   MIPSI_ADD_S = 0x46000000,
   MIPSI_SUB_S = 0x46000001,