summaryrefslogtreecommitdiffstats
path: root/js/src
diff options
context:
space:
mode:
authorJiaxun Yang <jiaxun.yang@flygoat.com>2020-05-12 12:40:10 +0800
committerMoonchild <moonchild@palemoon.org>2020-05-20 14:02:06 +0000
commitf83a88907a2014c6b1a157882b419debb054eb77 (patch)
treefa2a57c514303df68ab3741a49304cedbc3ab3c7 /js/src
parentff8603d7a2e51d2fd497493dfad7d4c8c7ee8d74 (diff)
downloadUXP-f83a88907a2014c6b1a157882b419debb054eb77.tar
UXP-f83a88907a2014c6b1a157882b419debb054eb77.tar.gz
UXP-f83a88907a2014c6b1a157882b419debb054eb77.tar.lz
UXP-f83a88907a2014c6b1a157882b419debb054eb77.tar.xz
UXP-f83a88907a2014c6b1a157882b419debb054eb77.zip
Bug 1424978 - IonMonkey: MIPS: Fix ma_addTestCarry
Tag: #1542
Diffstat (limited to 'js/src')
-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 38897de0d..839664b8c 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);
}