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 315902 64597bec5f4ee761798acbbe3f9690831ec7f5c7
parent 315901 c05925c3a813714fd3812b2e86669af453d10fdb
child 315903 e4decf2703b2e925b6a7f864fc800c8945881f27
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 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)
 {