Bug 1301400: Baseline Wasm Compiler: Part 10: Implement BitopI64, r=lth
authorHannes Verschore <hv1989@gmail.com>
Thu, 29 Sep 2016 22:33:23 +0200
changeset 315910 64597bec5f4ee761798acbbe3f9690831ec7f5c7
parent 315909 c05925c3a813714fd3812b2e86669af453d10fdb
child 315911 e4decf2703b2e925b6a7f864fc800c8945881f27
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 10: Implement BitopI64, r=lth
js/src/asmjs/WasmBaselineCompile.cpp
js/src/jit/MacroAssembler.h
js/src/jit/x64/MacroAssembler-x64-inl.h
--- a/js/src/asmjs/WasmBaselineCompile.cpp
+++ b/js/src/asmjs/WasmBaselineCompile.cpp
@@ -2485,37 +2485,25 @@ class BaseCompiler
         masm.movq(rdx, rax);
 #else
         MOZ_CRASH("BaseCompiler platform hook: remainderI64");
 #endif
         masm.bind(&done);
     }
 
     void orI64(RegI64 rhs, RegI64 srcDest) {
-#if defined(JS_CODEGEN_X64)
-        masm.orq(rhs.reg.reg, srcDest.reg.reg);
-#else
-        MOZ_CRASH("BaseCompiler platform hook: orI64");
-#endif
+        masm.or64(rhs.reg, srcDest.reg);
     }
 
     void andI64(RegI64 rhs, RegI64 srcDest) {
-#if defined(JS_CODEGEN_X64)
-        masm.andq(rhs.reg.reg, srcDest.reg.reg);
-#else
-        MOZ_CRASH("BaseCompiler platform hook: andI64");
-#endif
+        masm.and64(rhs.reg, srcDest.reg);
     }
 
     void xorI64(RegI64 rhs, RegI64 srcDest) {
-#if defined(JS_CODEGEN_X64)
-        masm.xorq(rhs.reg.reg, srcDest.reg.reg);
-#else
-        MOZ_CRASH("BaseCompiler platform hook: xorI64");
-#endif
+        masm.xor64(rhs.reg, srcDest.reg);
     }
 
     void lshiftI64(RegI64 rhs, RegI64 srcDest) {
 #if defined(JS_CODEGEN_X64)
         MOZ_ASSERT(rhs.reg.reg == rcx);
         masm.shlq_cl(srcDest.reg.reg);
 #else
         MOZ_CRASH("BaseCompiler platform hook: lshiftI64");
--- a/js/src/jit/MacroAssembler.h
+++ b/js/src/jit/MacroAssembler.h
@@ -723,17 +723,17 @@ class MacroAssembler : public MacroAssem
 
     inline void or32(Register src, Register dest) PER_SHARED_ARCH;
     inline void or32(Imm32 imm, Register dest) PER_SHARED_ARCH;
     inline void or32(Imm32 imm, const Address& dest) PER_SHARED_ARCH;
 
     inline void orPtr(Register src, Register dest) PER_ARCH;
     inline void orPtr(Imm32 imm, Register dest) PER_ARCH;
 
-    inline void and64(Register64 src, Register64 dest) DEFINED_ON(x86, arm);
+    inline void and64(Register64 src, Register64 dest) DEFINED_ON(x86, x64, arm);
     inline void or64(Register64 src, Register64 dest) PER_ARCH;
     inline void xor64(Register64 src, Register64 dest) PER_ARCH;
 
     inline void xor32(Register src, Register dest) PER_SHARED_ARCH;
     inline void xor32(Imm32 imm, Register dest) PER_SHARED_ARCH;
 
     inline void xorPtr(Register src, Register dest) PER_ARCH;
     inline void xorPtr(Imm32 imm, Register dest) PER_ARCH;
--- a/js/src/jit/x64/MacroAssembler-x64-inl.h
+++ b/js/src/jit/x64/MacroAssembler-x64-inl.h
@@ -85,16 +85,22 @@ MacroAssembler::orPtr(Register src, Regi
 
 void
 MacroAssembler::orPtr(Imm32 imm, Register dest)
 {
     orq(imm, dest);
 }
 
 void
+MacroAssembler::and64(Register64 src, Register64 dest)
+{
+    andq(src.reg, dest.reg);
+}
+
+void
 MacroAssembler::or64(Register64 src, Register64 dest)
 {
     orq(src.reg, dest.reg);
 }
 
 void
 MacroAssembler::xor64(Register64 src, Register64 dest)
 {