From 1e88d14e733a34aadffe8cfc95975e48ebc5417e Mon Sep 17 00:00:00 2001 From: "Nicolas B. Pierron" Date: Fri, 11 Sep 2015 13:47:54 +0200 Subject: [PATCH] Bug 1199719 part 6 - Move MacroAssembler::xor32 into the generic macro assembler. r=jandem --- js/src/jit/MacroAssembler.h | 3 +++ js/src/jit/arm/MacroAssembler-arm-inl.h | 6 ++++++ js/src/jit/arm/MacroAssembler-arm.cpp | 6 ------ js/src/jit/arm/MacroAssembler-arm.h | 1 - js/src/jit/arm64/MacroAssembler-arm64-inl.h | 6 ++++++ js/src/jit/arm64/MacroAssembler-arm64.h | 3 --- js/src/jit/mips32/MacroAssembler-mips32-inl.h | 6 ++++++ js/src/jit/mips32/MacroAssembler-mips32.cpp | 6 ------ js/src/jit/mips32/MacroAssembler-mips32.h | 1 - js/src/jit/none/MacroAssembler-none.h | 1 - .../jit/x86-shared/MacroAssembler-x86-shared-inl.h | 12 ++++++++++++ js/src/jit/x86-shared/MacroAssembler-x86-shared.h | 6 ------ 12 files changed, 33 insertions(+), 24 deletions(-) diff --git a/js/src/jit/MacroAssembler.h b/js/src/jit/MacroAssembler.h index ec5edbde243..27fb933325e 100644 --- a/js/src/jit/MacroAssembler.h +++ b/js/src/jit/MacroAssembler.h @@ -685,6 +685,9 @@ class MacroAssembler : public MacroAssemblerSpecific inline void orPtr(Register src, Register dest) PER_ARCH; inline void orPtr(Imm32 imm, Register dest) PER_ARCH; + inline void xor32(Register src, Register dest) DEFINED_ON(x86_shared); + inline void xor32(Imm32 imm, Register dest) PER_SHARED_ARCH; + //}}} check_macroassembler_style public: diff --git a/js/src/jit/arm/MacroAssembler-arm-inl.h b/js/src/jit/arm/MacroAssembler-arm-inl.h index fc384e492fb..1134f4d7eef 100644 --- a/js/src/jit/arm/MacroAssembler-arm-inl.h +++ b/js/src/jit/arm/MacroAssembler-arm-inl.h @@ -90,6 +90,12 @@ MacroAssembler::orPtr(Imm32 imm, Register dest) ma_orr(imm, dest); } +void +MacroAssembler::xor32(Imm32 imm, Register dest) +{ + ma_eor(imm, dest, SetCC); +} + //}}} check_macroassembler_style // =============================================================== diff --git a/js/src/jit/arm/MacroAssembler-arm.cpp b/js/src/jit/arm/MacroAssembler-arm.cpp index dd5b785a155..40d551d9877 100644 --- a/js/src/jit/arm/MacroAssembler-arm.cpp +++ b/js/src/jit/arm/MacroAssembler-arm.cpp @@ -1912,12 +1912,6 @@ MacroAssemblerARMCompat::add32(Imm32 imm, Register dest) ma_add(imm, dest, SetCC); } -void -MacroAssemblerARMCompat::xor32(Imm32 imm, Register dest) -{ - ma_eor(imm, dest, SetCC); -} - void MacroAssemblerARMCompat::add32(Imm32 imm, const Address& dest) { diff --git a/js/src/jit/arm/MacroAssembler-arm.h b/js/src/jit/arm/MacroAssembler-arm.h index 4083934ce01..7bc09044296 100644 --- a/js/src/jit/arm/MacroAssembler-arm.h +++ b/js/src/jit/arm/MacroAssembler-arm.h @@ -1200,7 +1200,6 @@ class MacroAssemblerARMCompat : public MacroAssemblerARM sub32(src, dest); j(cond, label); } - void xor32(Imm32 imm, Register dest); void xorPtr(Imm32 imm, Register dest); void xorPtr(Register src, Register dest); diff --git a/js/src/jit/arm64/MacroAssembler-arm64-inl.h b/js/src/jit/arm64/MacroAssembler-arm64-inl.h index 5f02cb6013c..af39df1f5da 100644 --- a/js/src/jit/arm64/MacroAssembler-arm64-inl.h +++ b/js/src/jit/arm64/MacroAssembler-arm64-inl.h @@ -102,6 +102,12 @@ MacroAssembler::orPtr(Imm32 imm, Register dest) Orr(ARMRegister(dest, 64), ARMRegister(dest, 64), Operand(imm.value)); } +void +MacroAssembler::xor32(Imm32 imm, Register dest) +{ + Eor(ARMRegister(dest, 32), ARMRegister(dest, 32), Operand(imm.value)); +} + //}}} check_macroassembler_style // =============================================================== diff --git a/js/src/jit/arm64/MacroAssembler-arm64.h b/js/src/jit/arm64/MacroAssembler-arm64.h index ce057db1bf4..e56f0889bc0 100644 --- a/js/src/jit/arm64/MacroAssembler-arm64.h +++ b/js/src/jit/arm64/MacroAssembler-arm64.h @@ -1081,9 +1081,6 @@ class MacroAssemblerCompat : public vixl::MacroAssembler void xorPtr(Imm32 imm, Register dest) { Eor(ARMRegister(dest, 64), ARMRegister(dest, 64), Operand(imm.value)); } - void xor32(Imm32 imm, Register dest) { - Eor(ARMRegister(dest, 32), ARMRegister(dest, 32), Operand(imm.value)); - } void xorPtr(Register src, Register dest) { Eor(ARMRegister(dest, 64), ARMRegister(dest, 64), Operand(ARMRegister(src, 64))); diff --git a/js/src/jit/mips32/MacroAssembler-mips32-inl.h b/js/src/jit/mips32/MacroAssembler-mips32-inl.h index 2c137031488..cef73fe36d8 100644 --- a/js/src/jit/mips32/MacroAssembler-mips32-inl.h +++ b/js/src/jit/mips32/MacroAssembler-mips32-inl.h @@ -87,6 +87,12 @@ MacroAssembler::orPtr(Imm32 imm, Register dest) ma_or(dest, imm); } +void +MacroAssembler::xor32(Imm32 imm, Register dest) +{ + ma_xor(dest, imm); +} + //}}} check_macroassembler_style // =============================================================== diff --git a/js/src/jit/mips32/MacroAssembler-mips32.cpp b/js/src/jit/mips32/MacroAssembler-mips32.cpp index 85afde66beb..b419722eca9 100644 --- a/js/src/jit/mips32/MacroAssembler-mips32.cpp +++ b/js/src/jit/mips32/MacroAssembler-mips32.cpp @@ -1573,12 +1573,6 @@ MacroAssemblerMIPSCompat::not32(Register reg) } // Logical operations -void -MacroAssemblerMIPSCompat::xor32(Imm32 imm, Register dest) -{ - ma_xor(dest, imm); -} - void MacroAssemblerMIPSCompat::xorPtr(Imm32 imm, Register dest) { diff --git a/js/src/jit/mips32/MacroAssembler-mips32.h b/js/src/jit/mips32/MacroAssembler-mips32.h index 81874f18bac..93f9aa60ffe 100644 --- a/js/src/jit/mips32/MacroAssembler-mips32.h +++ b/js/src/jit/mips32/MacroAssembler-mips32.h @@ -1131,7 +1131,6 @@ class MacroAssemblerMIPSCompat : public MacroAssemblerMIPS } } - void xor32(Imm32 imm, Register dest); void xorPtr(Imm32 imm, Register dest); void xorPtr(Register src, Register dest); void addPtr(Register src, Register dest); diff --git a/js/src/jit/none/MacroAssembler-none.h b/js/src/jit/none/MacroAssembler-none.h index 0ded8e4775a..7817948f479 100644 --- a/js/src/jit/none/MacroAssembler-none.h +++ b/js/src/jit/none/MacroAssembler-none.h @@ -426,7 +426,6 @@ class MacroAssemblerNone : public Assembler void rshiftPtrArithmetic(Imm32, Register) { MOZ_CRASH(); } void lshiftPtr(Imm32, Register) { MOZ_CRASH(); } template void xorPtr(T, S) { MOZ_CRASH(); } - template void xor32(T, S) { MOZ_CRASH(); } template void not32(T) { MOZ_CRASH(); } void convertUInt32ToDouble(Register, FloatRegister) { MOZ_CRASH(); } void convertUInt32ToFloat32(Register, FloatRegister) { MOZ_CRASH(); } diff --git a/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h b/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h index ae17ed571a2..308c9cac715 100644 --- a/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h +++ b/js/src/jit/x86-shared/MacroAssembler-x86-shared-inl.h @@ -58,6 +58,18 @@ MacroAssembler::or32(Imm32 imm, const Address& dest) orl(imm, Operand(dest)); } +void +MacroAssembler::xor32(Register src, Register dest) +{ + xorl(src, dest); +} + +void +MacroAssembler::xor32(Imm32 imm, Register dest) +{ + xorl(imm, dest); +} + //}}} check_macroassembler_style // =============================================================== diff --git a/js/src/jit/x86-shared/MacroAssembler-x86-shared.h b/js/src/jit/x86-shared/MacroAssembler-x86-shared.h index af337591df1..09968131636 100644 --- a/js/src/jit/x86-shared/MacroAssembler-x86-shared.h +++ b/js/src/jit/x86-shared/MacroAssembler-x86-shared.h @@ -190,12 +190,6 @@ class MacroAssemblerX86Shared : public Assembler sub32(src, dest); j(cond, label); } - void xor32(Imm32 imm, Register dest) { - xorl(imm, dest); - } - void xor32(Register src, Register dest) { - xorl(src, dest); - } void not32(Register reg) { notl(reg); }