aboutsummaryrefslogtreecommitdiff
path: root/src/shader_recompiler
diff options
context:
space:
mode:
authorTakoroka <137927095+Takoroka@users.noreply.github.com>2026-10-30 14:22:24 -0400
committerTakoroka <137927095+Takoroka@users.noreply.github.com>2026-11-01 11:09:35 -0500
commit328d8df61274319401ff08de7aedd980e54c89b3 (patch)
tree85fc256492d37aec8a5620a77e126de7c282965e /src/shader_recompiler
parent9e2e50aed768b3aff72cfe871ff93de3373886ff (diff)
nx2: lower IADD3.X with a register and a constant buffer operand
The constant buffer IADD3.X lowering took only RZ as the first source. Kirby Air Riders adds a register (IADD3.X R32, R32, c[0x3][0x48], RZ, PT, !PT); add it to the carry before the constant.
Diffstat (limited to 'src/shader_recompiler')
-rw-r--r--src/shader_recompiler/frontend/ampere/lower_to_maxwell.h5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/shader_recompiler/frontend/ampere/lower_to_maxwell.h b/src/shader_recompiler/frontend/ampere/lower_to_maxwell.h
index 739f3b10d0..9cbd45ab88 100644
--- a/src/shader_recompiler/frontend/ampere/lower_to_maxwell.h
+++ b/src/shader_recompiler/frontend/ampere/lower_to_maxwell.h
@@ -2244,12 +2244,13 @@ inline LoweredProgram LowerToMaxwell(std::span<const Instruction> code) {
break;
}
if (opcode == 0xa10 && insn.Bits(74, 1)) {
- if (insn.Bits(24, 8) != 255 || (insn.words[2] & ~0x07800000U) != 0x007fe4ffU)
+ if ((insn.words[2] & ~0x07800000U) != 0x007fe4ffU)
return fail(index, "native extended constant add mode");
- const u32 b = operand(1, false);
+ const u32 a = insn.Bits(24, 8), b = operand(1, false);
mov_imm(250, 1);
emit(0x5ca0000000000000ULL | predicate | 250 | (u64{250} << 8) | (u64{255} << 20) |
(u64{insn.Bits(87, 3)} << 39) | (u64{insn.Bits(90, 1)} << 42));
+ if (a != 255) emit(0x5c10000000000000ULL | predicate | 250 | (u64{a} << 8) | (u64{250} << 20));
emit(base(0x5c10000000000000ULL) | (u64{b} << 8) | (u64{250} << 20));
break;
}