Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit 99ad580

Browse files
CSharperMantlejandem
authored andcommitted
Bug 1975645 - [riscv64] Part 2: Implement MacroAssembler::branchTestPtr. r=jandem
Differential Revision: https://phabricator.services.mozilla.com/D256069
1 parent 4b16e79 commit 99ad580

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

js/src/jit/riscv64/MacroAssembler-riscv64-inl.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1127,7 +1127,13 @@ void MacroAssembler::branchTestPtr(Condition cond, Register lhs, Imm32 rhs,
11271127

11281128
void MacroAssembler::branchTestPtr(Condition cond, Register lhs, ImmWord rhs,
11291129
Label* label) {
1130-
MOZ_CRASH("NYI");
1130+
MOZ_ASSERT(cond == Zero || cond == NonZero || cond == Signed ||
1131+
cond == NotSigned);
1132+
UseScratchRegisterScope temps(this);
1133+
Register scratch = temps.Acquire();
1134+
ma_li(scratch, rhs);
1135+
ma_and(scratch, lhs, scratch);
1136+
ma_b(scratch, scratch, label, cond);
11311137
}
11321138

11331139
void MacroAssembler::branchTestPtr(Condition cond, const Address& lhs,

0 commit comments

Comments
 (0)