summaryrefslogtreecommitdiff
path: root/js/src/jit/mips32
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2020-05-12 12:40:13 +0800
committerJiaxun Yang <jiaxun.yang@flygoat.com>2020-05-14 16:31:59 +0800
commit9679f714f7c3a1da7af0ddd1c2005f8f7ffd039b (patch)
treec8e7c6b7ae75be9131ae3add2fc4af7be80b3cbe /js/src/jit/mips32
parent53662b791d5f860791fea476c6377438cc60f921 (diff)
downloaduxp-9679f714f7c3a1da7af0ddd1c2005f8f7ffd039b.tar.gz
Bug 1441521 : [MIPS] Optimize comparation with small constants
Tag: #1542
Diffstat (limited to 'js/src/jit/mips32')
-rw-r--r--js/src/jit/mips32/MacroAssembler-mips32.cpp13
-rw-r--r--js/src/jit/mips32/MacroAssembler-mips32.h19
2 files changed, 13 insertions, 19 deletions
diff --git a/js/src/jit/mips32/MacroAssembler-mips32.cpp b/js/src/jit/mips32/MacroAssembler-mips32.cpp
index b4a148d8f7..7472ed78b8 100644
--- a/js/src/jit/mips32/MacroAssembler-mips32.cpp
+++ b/js/src/jit/mips32/MacroAssembler-mips32.cpp
@@ -503,19 +503,6 @@ MacroAssemblerMIPS::ma_b(Address addr, ImmGCPtr imm, Label* label, Condition c,
ma_b(SecondScratchReg, imm, label, c, jumpKind);
}
-void
-MacroAssemblerMIPS::ma_cmp_set(Register rd, Register rs, Address addr, Condition c)
-{
- ma_lw(ScratchRegister, addr);
- ma_cmp_set(rd, rs, ScratchRegister, c);
-}
-
-void
-MacroAssemblerMIPS::ma_cmp_set(Register dst, Address lhs, Register rhs, Condition c)
-{
- ma_lw(ScratchRegister, lhs);
- ma_cmp_set(dst, ScratchRegister, rhs, c);
-}
// fp instructions
void
diff --git a/js/src/jit/mips32/MacroAssembler-mips32.h b/js/src/jit/mips32/MacroAssembler-mips32.h
index 69e7c4fe5e..37d279b09a 100644
--- a/js/src/jit/mips32/MacroAssembler-mips32.h
+++ b/js/src/jit/mips32/MacroAssembler-mips32.h
@@ -104,7 +104,7 @@ class MacroAssemblerMIPS : public MacroAssemblerMIPSShared
void ma_b(Address addr, ImmGCPtr imm, Label* l, Condition c, JumpKind jumpKind = MixedJump);
void ma_b(Address addr, Register rhs, Label* l, Condition c, JumpKind jumpKind = MixedJump) {
MOZ_ASSERT(rhs != ScratchRegister);
- ma_load(ScratchRegister, addr, SizeWord);
+ ma_lw(ScratchRegister, addr);
ma_b(ScratchRegister, rhs, l, c, jumpKind);
}
@@ -125,12 +125,19 @@ class MacroAssemblerMIPS : public MacroAssemblerMIPSShared
void ma_cmp_set(Register dst, Register lhs, ImmPtr imm, Condition c) {
ma_cmp_set(dst, lhs, Imm32(uint32_t(imm.value)), c);
}
- void ma_cmp_set(Register rd, Register rs, Address addr, Condition c);
- void ma_cmp_set(Register dst, Address lhs, Register rhs, Condition c);
- void ma_cmp_set(Register dst, Address lhs, ImmPtr imm, Condition c) {
+ void ma_cmp_set(Register dst, Register lhs, Address addr, Condition c) {
+ MOZ_ASSERT(lhs != ScratchRegister);
+ ma_lw(ScratchRegister, addr);
+ ma_cmp_set(dst, lhs, ScratchRegister, c);
+ }
+ void ma_cmp_set(Register dst, Address lhs, Register rhs, Condition c) {
+ MOZ_ASSERT(rhs != ScratchRegister);
ma_lw(ScratchRegister, lhs);
- ma_li(SecondScratchReg, Imm32(uint32_t(imm.value)));
- ma_cmp_set(dst, ScratchRegister, SecondScratchReg, c);
+ ma_cmp_set(dst, ScratchRegister, rhs, c);
+ }
+ void ma_cmp_set(Register dst, Address lhs, ImmPtr imm, Condition c) {
+ ma_lw(SecondScratchReg, lhs);
+ ma_cmp_set(dst, SecondScratchReg, imm, c);
}
// These fuctions abstract the access to high part of the double precision