Bug 1301400: Baseline Wasm Compiler: Part 13: Implement ClzI64 and CtzI64, r=lth
authorh4writer <hv1989@gmail.com>
Thu, 29 Sep 2016 22:33:23 +0200
changeset 315827 f2347550ce3615df67a42265afdcbc3223b381b0
parent 315826 f5bbefafb7c43160f1aa813a3e9f55fede76fd8d
child 315828 e3245fe9958ea375e1d9471ad933cd3b44704be1
push id82285
push userhv1989@gmail.com
push dateThu, 29 Sep 2016 20:34:17 +0000
treeherdermozilla-inbound@9643bfae6b31 [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 13: Implement ClzI64 and CtzI64, r=lth
js/src/asmjs/WasmBaselineCompile.cpp
--- a/js/src/asmjs/WasmBaselineCompile.cpp
+++ b/js/src/asmjs/WasmBaselineCompile.cpp
@@ -2537,28 +2537,30 @@ class BaseCompiler
 #ifdef JS_PUNBOX64
         masm.rotateLeft64(shift.reg.reg, srcDest.reg, srcDest.reg, Register::Invalid());
 #else
         masm.rotateLeft64(shift.reg.low, srcDest.reg, srcDest.reg, shift.reg.high);
 #endif
     }
 
     void clzI64(RegI64 srcDest) {
-#if defined(JS_CODEGEN_X64)
+#ifdef JS_PUNBOX64
         masm.clz64(srcDest.reg, srcDest.reg.reg);
 #else
-        MOZ_CRASH("BaseCompiler platform hook: clzI64");
+        masm.clz64(srcDest.reg, srcDest.reg.low);
+        masm.move32(Imm32(0), srcDest.reg.high);
 #endif
     }
 
     void ctzI64(RegI64 srcDest) {
-#if defined(JS_CODEGEN_X64)
+#ifdef JS_PUNBOX64
         masm.ctz64(srcDest.reg, srcDest.reg.reg);
 #else
-        MOZ_CRASH("BaseCompiler platform hook: ctzI64");
+        masm.ctz64(srcDest.reg, srcDest.reg.low);
+        masm.move32(Imm32(0), srcDest.reg.high);
 #endif
     }
 
     bool popcnt32NeedsTemp() const {
 #if defined(JS_CODEGEN_X86) || defined(JS_CODEGEN_X64)
         return !AssemblerX86Shared::HasPOPCNT();
 #else
         MOZ_CRASH("BaseCompiler platform hook: popcnt32NeedsTemp");