Bug 1279248 - Part 16: Implement the 64bit variant of WrapInt64ToInt32 on x86, r=efaust
authorHannes Verschore <hv1989@gmail.com>
Fri, 29 Jul 2016 16:51:42 +0200
changeset 347337 bd1c4839cd6648e1bed6f9ee3edcd8fd1aa688cf
parent 347336 27f7299c045472b8f1e4cab8744190045b14d90c
child 347338 91846989e364b13a754ed4012cc9f6c5e13043cb
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersefaust
bugs1279248
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1279248 - Part 16: Implement the 64bit variant of WrapInt64ToInt32 on x86, r=efaust
js/src/jit/x86/CodeGenerator-x86.cpp
js/src/jit/x86/CodeGenerator-x86.h
--- a/js/src/jit/x86/CodeGenerator-x86.cpp
+++ b/js/src/jit/x86/CodeGenerator-x86.cpp
@@ -1458,8 +1458,17 @@ CodeGeneratorX86::visitExtendInt32ToInt6
         masm.xorl(output.high, output.high);
     } else {
         MOZ_ASSERT(output.low == input);
         MOZ_ASSERT(output.low == eax);
         MOZ_ASSERT(output.high == edx);
         masm.cdq();
     }
 }
+
+void
+CodeGeneratorX86::visitWrapInt64ToInt32(LWrapInt64ToInt32* lir)
+{
+    const LInt64Allocation& input = lir->getInt64Operand(0);
+    Register output = ToRegister(lir->output());
+
+    masm.movl(ToRegister(input.low()), output);
+}
--- a/js/src/jit/x86/CodeGenerator-x86.h
+++ b/js/src/jit/x86/CodeGenerator-x86.h
@@ -76,16 +76,17 @@ class CodeGeneratorX86 : public CodeGene
     void visitCompareI64(LCompareI64* lir);
     void visitCompareI64AndBranch(LCompareI64AndBranch* lir);
     void visitDivOrModI64(LDivOrModI64* lir);
     void visitUDivOrModI64(LUDivOrModI64* lir);
     void visitAsmSelectI64(LAsmSelectI64* lir);
     void visitAsmReinterpretFromI64(LAsmReinterpretFromI64* lir);
     void visitAsmReinterpretToI64(LAsmReinterpretToI64* lir);
     void visitExtendInt32ToInt64(LExtendInt32ToInt64* lir);
+    void visitWrapInt64ToInt32(LWrapInt64ToInt32* lir);
 
   private:
     void asmJSAtomicComputeAddress(Register addrTemp, Register ptrReg,
                                    const MWasmMemoryAccess* access);
 };
 
 typedef CodeGeneratorX86 CodeGeneratorSpecific;