Bug 1549667 - [mips] Add function cmp32Move{32,ptr}.
☠☠ backed out by d4a9de6a57b7 ☠ ☠
authorYu Yin <yuyin-hf@loongson.cn>
Fri, 10 May 2019 09:39:58 +0300
changeset 535233 b661a2bf1626fcf9cef6915dffbff50a6c6dc289
parent 535232 adb37249163ee7243b14417e5771faa8564c985e
child 535234 5d580fa5d7531f846acac842f7c9eec92a52a460
push id2082
push userffxbld-merge
push dateMon, 01 Jul 2019 08:34:18 +0000
treeherdermozilla-release@2fb19d0466d2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1549667
milestone68.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 1549667 - [mips] Add function cmp32Move{32,ptr}. Reviewers: jandem Reviewed By: jandem Subscribers: jandem Bug #: 1549667 Differential Revision: https://phabricator.services.mozilla.com/D30165
js/src/jit/mips-shared/MacroAssembler-mips-shared-inl.h
--- a/js/src/jit/mips-shared/MacroAssembler-mips-shared-inl.h
+++ b/js/src/jit/mips-shared/MacroAssembler-mips-shared-inl.h
@@ -782,28 +782,37 @@ void MacroAssembler::branchTestMagic(Con
 
 void MacroAssembler::branchToComputedAddress(const BaseIndex& addr) {
   loadPtr(addr, ScratchRegister);
   branch(ScratchRegister);
 }
 
 void MacroAssembler::cmp32Move32(Condition cond, Register lhs, Register rhs,
                                  Register src, Register dest) {
-  MOZ_CRASH();
+  Register scratch = ScratchRegister;
+  MOZ_ASSERT(src != scratch && dest != scratch);
+  cmp32Set(cond, lhs, rhs, scratch);
+  as_movn(dest, src, scratch);
 }
 
 void MacroAssembler::cmp32MovePtr(Condition cond, Register lhs, Imm32 rhs,
                                   Register src, Register dest) {
-  MOZ_CRASH();
+  Register scratch = ScratchRegister;
+  MOZ_ASSERT(src != scratch && dest != scratch);
+  cmp32Set(cond, lhs, rhs, scratch);
+  as_movn(dest, src, scratch);
 }
 
 void MacroAssembler::cmp32Move32(Condition cond, Register lhs,
                                  const Address& rhs, Register src,
                                  Register dest) {
-  MOZ_CRASH();
+  SecondScratchRegisterScope scratch2(*this);
+  MOZ_ASSERT(lhs != scratch2 && src != scratch2 && dest != scratch2);
+  load32(rhs, scratch2);
+  cmp32Move32(cond, lhs, scratch2, src, dest);
 }
 
 void MacroAssembler::cmp32Load32(Condition cond, Register lhs,
                                  const Address& rhs, const Address& src,
                                  Register dest) {
   // This is never used, but must be present to facilitate linking on mips(64).
   MOZ_CRASH("No known use cases");
 }