Issue #3049 - loongarch64: fill scalar macroassembler NYI helpers

This commit is contained in:
Basilisk-Dev 2026-04-26 11:45:20 -04:00 committed by wuggy
commit 325e7c26d8
2 changed files with 28 additions and 6 deletions

View file

@ -973,8 +973,17 @@ void MacroAssembler::branchAdd32(Condition cond, T src, Register dest,
case CarrySet:
ma_add32TestCarry(cond, dest, dest, src, overflow);
break;
case Equal:
case NotEqual:
case Zero:
case NonZero:
case Signed:
case NotSigned:
add32(src, dest);
ma_b(dest, Imm32(0), overflow, cond);
break;
default:
MOZ_CRASH("NYI");
MOZ_CRASH("Unexpected branchAdd32 condition");
}
}
@ -986,15 +995,28 @@ void MacroAssembler::branchSub32(Condition cond, T src, Register dest,
case Overflow:
ma_sub32TestOverflow(dest, dest, src, overflow);
break;
case CarrySet:
case CarryClear: {
ScratchRegisterScope scratch(asMasm());
SecondScratchRegisterScope scratch2(asMasm());
Register negSrc = dest == scratch ? Register(scratch2) : Register(scratch);
ma_sub_w(negSrc, zero, src);
// a - b borrows iff a + (-b) does not carry.
ma_add32TestCarry(cond == CarrySet ? CarryClear : CarrySet, dest, dest,
negSrc, overflow);
break;
}
case Equal:
case NotEqual:
case NonZero:
case Zero:
case Signed:
case NotSigned:
ma_sub_w(dest, dest, src);
ma_b(dest, dest, overflow, cond);
sub32(src, dest);
ma_b(dest, Imm32(0), overflow, cond);
break;
default:
MOZ_CRASH("NYI");
MOZ_CRASH("Unexpected branchSub32 condition");
}
}
void MacroAssembler::decBranchPtr(Condition cond, Register lhs, Imm32 rhs,

View file

@ -702,8 +702,8 @@ class MacroAssemblerLOONGARCH64Compat : public MacroAssemblerLOONGARCH64 {
mov(ImmWord(uintptr_t(imm.value)), dest);
}
void mov(CodeLabel* label, Register dest) { ma_li(dest, label); }
void mov(Register src, Address dest) { MOZ_CRASH("NYI-IC"); }
void mov(Address src, Register dest) { MOZ_CRASH("NYI-IC"); }
void mov(Register src, Address dest) { storePtr(src, dest); }
void mov(Address src, Register dest) { loadPtr(src, dest); }
void writeDataRelocation(const Value& val) {
// Raw GC pointer relocations and Value relocations both end up in