Преглед изворни кода

MIPS: Compile math.sqrt() to sqrt.d instruction.

Mike Pall пре 13 година
родитељ
комит
bbe35adfcd
2 измењених фајлова са 3 додато и 0 уклоњено
  1. 2 0
      src/lj_asm_mips.h
  2. 1 0
      src/lj_target_mips.h

+ 2 - 0
src/lj_asm_mips.h

@@ -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;

+ 1 - 0
src/lj_target_mips.h

@@ -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,