summaryrefslogtreecommitdiff
path: root/js/src/jit
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2020-05-12 12:40:10 +0800
committerJiaxun Yang <jiaxun.yang@flygoat.com>2020-05-14 16:31:58 +0800
commit24d8c2502685dc433da896b1882d4a65c902cc03 (patch)
tree3d76e3bb6afff87576d29413fdf0d9e0b7344ae4 /js/src/jit
parentebc0e55033a4b1fef889d33526ddd485230f2b7d (diff)
downloaduxp-24d8c2502685dc433da896b1882d4a65c902cc03.tar.gz
Bug 1424978 - IonMonkey: MIPS: Fix ma_addTestCarry
Tag: #1542
Diffstat (limited to 'js/src/jit')
-rw-r--r--js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp b/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
index 38897de0d5..839664b8ce 100644
--- a/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
+++ b/js/src/jit/mips-shared/MacroAssembler-mips-shared.cpp
@@ -236,8 +236,14 @@ template <typename L>
void
MacroAssemblerMIPSShared::ma_addTestCarry(Register rd, Register rs, Register rt, L overflow)
{
- as_addu(rd, rs, rt);
- as_sltu(SecondScratchReg, rd, rs);
+ if (rd != rs) {
+ as_addu(rd, rs, rt);
+ as_sltu(SecondScratchReg, rd, rs);
+ } else {
+ ma_move(SecondScratchReg, rs);
+ as_addu(rd, rs, rt);
+ as_sltu(SecondScratchReg, rd, SecondScratchReg);
+ }
ma_b(SecondScratchReg, SecondScratchReg, overflow, Assembler::NonZero);
}