Bug 1301400: Baseline Wasm Compiler: Part 15: Implement ReinterpretI64, r=lth
authorHannes Verschore <hv1989@gmail.com>
Thu, 29 Sep 2016 22:33:23 +0200
changeset 315907 1acadee786e9c7fb213339159546826d419a350f
parent 315906 e3245fe9958ea375e1d9471ad933cd3b44704be1
child 315908 ef547be7cb2f35d01bfffd9eaeeeacc1cdb98c17
push id30757
push usercbook@mozilla.com
push dateFri, 30 Sep 2016 10:02:43 +0000
treeherdermozilla-central@5ffed033557e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth
bugs1301400
milestone52.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 1301400: Baseline Wasm Compiler: Part 15: Implement ReinterpretI64, r=lth
js/src/asmjs/WasmBaselineCompile.cpp
--- a/js/src/asmjs/WasmBaselineCompile.cpp
+++ b/js/src/asmjs/WasmBaselineCompile.cpp
@@ -2585,24 +2585,34 @@ class BaseCompiler
 
     void popcntI64(RegI64 srcDest, RegI32 tmp) {
         masm.popcnt64(srcDest.reg, srcDest.reg, tmp.reg);
     }
 
     void reinterpretI64AsF64(RegI64 src, RegF64 dest) {
 #if defined(JS_CODEGEN_X64)
         masm.vmovq(src.reg.reg, dest.reg);
+#elif defined(JS_CODEGEN_X86)
+        masm.Push(src.reg.high);
+        masm.Push(src.reg.low);
+        masm.vmovq(Operand(esp, 0), dest.reg);
+        masm.freeStack(sizeof(uint64_t));
 #else
         MOZ_CRASH("BaseCompiler platform hook: reinterpretI64AsF64");
 #endif
     }
 
     void reinterpretF64AsI64(RegF64 src, RegI64 dest) {
 #if defined(JS_CODEGEN_X64)
         masm.vmovq(src.reg, dest.reg.reg);
+#elif defined(JS_CODEGEN_X86)
+        masm.reserveStack(sizeof(uint64_t));
+        masm.vmovq(src.reg, Operand(esp, 0));
+        masm.Pop(dest.reg.low);
+        masm.Pop(dest.reg.high);
 #else
         MOZ_CRASH("BaseCompiler platform hook: reinterpretF64AsI64");
 #endif
     }
 
     void wrapI64ToI32(RegI64 src, RegI32 dest) {
 #if defined(JS_CODEGEN_X64)
         // movl clears the high bits if the two registers are the same.