Shaders: v_fmac/v_mac's VOP3 accumulator takes its abs and neg bits #213

Closed
github-bot wants to merge 0 commits from github-bot/gh-213 into main AGit
Owner

@⁠xndbogdan on GitHub · 2026-11-30 21:50 UTC · original
xndbogdan:shaders/fmac-accumulator-modifiers → main · +72 −3 · 2 files · 47 commits · closed without merging

In the VOP3 form of v_fmac_f32, v_mac_f32, v_mac_legacy_f32 and v_fmac_f16, the accumulator is source 2, and the instruction's abs and neg bits for source 2 apply to it. The translator dropped them, so wherever a program sets them the accumulator's sign is wrong: a * b + |c| or a * b - c came out as a * b + c.

  • f32: the accumulator takes FAbs and -0.0 - x, as the other sources do in fsrc/half_fsrc. Ported from trustno1-coder/VIctory-NVIDIA#2387, which credits SmokinDoinkV1 (GPL-3.0).
  • f16: the same for v_fmac_f16, done on the accumulator's 16 bits before it is widened (clear or flip bit 15). This part isn't in #2387; that fork still has the gap.

Programs that don't set these bits translate exactly as before.

Tests

On an RTX 5080 (driver 621.24) and WARP, Windows 11 build 26300:

  • New: vop3_accumulators_take_their_abs_and_neg_bits runs each of the four instructions with none, abs, neg and both on the accumulator (2 * 3 + acc, acc = -1) and checks for 5, 7, 7 and 5. On main it fails at the first case (v_fmac_f32 abs: 5, want 7).
  • Full cargo test -p victory-shader and cargo clippy: running; I will add the results here.

Not done

  • No game run. I don't have the game, so I don't know how often the title sets these bits.

AI-assisted (Claude Code).

🤖 Generated with Claude Code

**@⁠xndbogdan** on GitHub · 2026-11-30 21:50 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/213) `xndbogdan:shaders/fmac-accumulator-modifiers` → `main` · +72 −3 · 2 files · 47 commits · closed without merging In the VOP3 form of `v_fmac_f32`, `v_mac_f32`, `v_mac_legacy_f32` and `v_fmac_f16`, the accumulator is source 2, and the instruction's abs and neg bits for source 2 apply to it. The translator dropped them, so wherever a program sets them the accumulator's sign is wrong: `a * b + |c|` or `a * b - c` came out as `a * b + c`. - **f32:** the accumulator takes `FAbs` and `-0.0 - x`, as the other sources do in `fsrc`/`half_fsrc`. Ported from trustno1-coder/VIctory-NVIDIA#2387, which credits SmokinDoinkV1 (GPL-3.0). - **f16:** the same for `v_fmac_f16`, done on the accumulator's 16 bits before it is widened (clear or flip bit 15). This part isn't in #2387; that fork still has the gap. Programs that don't set these bits translate exactly as before. ## Tests On an RTX 5080 (driver 621.24) and WARP, Windows 11 build 26300: - New: `vop3_accumulators_take_their_abs_and_neg_bits` runs each of the four instructions with none, abs, neg and both on the accumulator (`2 * 3 + acc`, `acc = -1`) and checks for 5, 7, 7 and 5. On `main` it fails at the first case (`v_fmac_f32 abs`: 5, want 7). - Full `cargo test -p victory-shader` and `cargo clippy`: running; I will add the results here. ## Not done - **No game run.** I don't have the game, so I don't know how often the title sets these bits. _AI-assisted (Claude Code)._ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
In the VOP3 form of v_fmac_f32, v_mac_f32, v_mac_legacy_f32 and
v_fmac_f16 the accumulator is source 2, and its abs and neg bits apply to
it. They were dropped: a * b + |c| or a * b - c came out as a * b + c.
The f32 accumulator takes FAbs and -0.0 - x, as the other sources do; the
f16 one has bit 15 cleared or flipped before it is widened. Programs that
do not set these bits translate as before.

The f32 part follows trustno1-coder/VIctory-NVIDIA#2387 (after
SmokinDoinkV1, GPL-3.0); the f16 part is new.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 21:55:10 +00:00
github-bot closed this pull request 2026-12-01 01:10:21 +00:00
Author
Owner

@⁠readmet3xt-lab on GitHub · 2026-12-01 01:36 UTC · original

A note on why this shows as closed: GitHub closed every open pull request by itself when main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), and they cannot be reopened. This is not a rejection.

Your change is in the batch being tested for the next release, carried over as one commit with you as its author. Nothing is needed from you now; the result will be posted here.

**@⁠readmet3xt-lab** on GitHub · 2026-12-01 01:36 UTC · [original](https://github.com/readmet3xt-lab/foxhound/pull/213#issuecomment-7297694305) A note on why this shows as closed: GitHub closed every open pull request by itself when main's history was rewritten on 2026-12-01 (text-only changes; every commit hash changed), and they cannot be reopened. This is not a rejection. Your change is in the batch being tested for the next release, carried over as one commit with you as its author. Nothing is needed from you now; the result will be posted here.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.