shader: preserve raw EXEC and VCC bits in 64-bit scalar selects

This commit is contained in:
nmzik
2026-10-04 13:06:46 +04:00
parent 783d9f8d6b
commit efbaa17f71
3 changed files with 95 additions and 19 deletions
@@ -256,13 +256,14 @@ void Translator::ScalarSelect64(const Decoder::Instruction& inst,
const auto selected_mask_valid =
IR::U1(ir.Emit(IR::ValueOpcode::SelectU1,
{condition, ReadMaskValid(inst.src0), ReadMaskValid(false_source)}));
if (IsExecOrVcc(inst.dst)) {
WriteMask(inst.dst, selected_mask, true);
return;
}
WriteU32Pair(inst.dst,
{ir.Select(condition, lhs[0], rhs[0]), ir.Select(condition, lhs[1], rhs[1])});
if (inst.dst.kind == Decoder::OperandKind::Sgpr) {
// Scalar selects preserve the raw pair even when EXEC/VCC holds an address.
if (inst.dst.kind == Decoder::OperandKind::ExecLo) {
ir.SetExec(selected_mask);
} else if (inst.dst.kind == Decoder::OperandKind::VccLo) {
ir.SetVcc(selected_mask);
} else if (inst.dst.kind == Decoder::OperandKind::Sgpr) {
const auto dst = static_cast<IR::ScalarReg>(inst.dst.reg);
ir.SetThreadBitScalarReg(dst, selected_mask);
ir.SetScalarMaskTag(dst, selected_mask_valid);