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 315913 f2347550ce3615df67a42265afdcbc3223b381b0
parent 315912 f5bbefafb7c43160f1aa813a3e9f55fede76fd8d
child 315914 e3245fe9958ea375e1d9471ad933cd3b44704be1
push id20634
push usercbook@mozilla.com
push dateFri, 30 Sep 2016 10:10:13 +0000
treeherderfx-team@afe79b010d13 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth
bugs1301400
milestone52.0a1
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");