fix(shader): detect f32 tininess after rounding when flushing products #2839

Merged
CouchRiv merged 2 commits from upstream-pr/2839 into main 2026-10-10 22:57:21 +00:00
CouchRiv commented 2026-10-10 16:24:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CouchRiv on 2026-10-10T16:24:49Z.


What

With f32 denormals flushed (FLOAT_MODE 0xc0, the usual one), v_mul_f32 v0, 0x3f7ffffe, v1 with v1 = 0x00800001 gives 0x00000000. RDNA2 gives 0x00800000.

The exact product is 2^-126 * (1 - 2^-46). It is below 2^-126, but rounded to 24 bits it is exactly 2^-126. The tiny-product check from #1850 tests the exact product (tininess before rounding), so it flushes it. The hardware tests the product rounded to 24 bits with an unbounded exponent, in the shader's f32 round mode (tininess after rounding).

flushTinyProduct now flushes only when the rounded product is below 2^-126. A product that rounds up to 2^-126 gives 2^-126 with the product's sign. This needs one more 32-bit multiply (the low half of the significand product) and is settled for the FLOAT_MODE round mode (bits 1:0) at translation time. Everything else stays the same: callers, the nonzero-addend rule, #2020's constant-factor shortcuts (a power-of-two factor gives an exact product, so it skips the rounding check as well as the multiply-high), and the products themselves, which are still rounded to nearest even. v_mad_legacy_f32 and v_mac_legacy_f32 keep the exact-product check: on the console they round the product separately, and that encoding is not measured at this boundary (RDNA2 runs a fused form of it).

Measured on RDNA2 (gfx1036, Radeon 610M) with tools/hw-oracle, wave32, DX10_CLAMP=1, f32 denormals flushed. To nearest it was measured at IEEE=0 and IEEE=1 (same bits), and the other round modes at IEEE=0. Products are 2^-126 * (1 - D/2^47). At 24 bits, D < 2^22 rounds up to 2^-126 to nearest and D = 2^22 is a tie. Rounding away from zero (+inf for a positive product, -inf for a negative one) rounds up any D < 2^23:

x * y D nearest +inf -inf zero main, nearest
0x00800001 * 0x3f7ffffe 2 0x00800000 0x00800000 0x00000000 0x00000000 0x00000000
0x80800001 * 0x3f7ffffe 2 0x80800000 0x80000000 0x80800000 0x80000000 0x80000000
0x008003e6 * 0x3f7ff834 1992008 0x00800000 0x00800000 0x00000000 0x00000000 0x00000000
0x008005a8 * 0x3f7ff4b0 4193408 0x00800000 0x00800000 0x00000000 0x00000000 0x00000000
0x00f80000 * 0x3f042108 2^22 (tie) 0x00800000 0x00800000 0x00000000 0x00000000 0x00000000
0x008005a9 * 0x3f7ff4ae 4199202 0x00000000 0x00800000 0x00000000 0x00000000 0x00000000
0x00800f95 * 0x3f7fe0d9 6646451 0x00000000 0x00800000 0x00000000 0x00000000 0x00000000
0x00800001 * 0x3f7ffffd 8388611 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000
0x00ffffff * 0x3f000000 2^23 (exact) 0x00000000 0x00000000 0x00000000 0x00000000 0x00000000

v_mul_f32, v_mul_legacy_f32, v_fma_f32, v_fmac_f32, v_fmamk_f32, v_fmaak_f32 and v_fma_mix_f32 with all-f32 sources with a ±0 addend give the same bits when they evaluate the same tiny product. v_mullit_f32, which uses the same check since #2046, does too: on gfx1036 it gives the same bits as v_mul_f32 on all 16 rows measured. The 6646451 row rules out "round to a denormal, then flush": with denormals kept, it gives 0x00800000.

Mixed f16/f32 v_fma_mix_f32 uses the same after-rounding boundary. Fresh measurements on the same gfx1036 GPU cover f16 in either multiplicand slot, low and high half selection, both product signs, and f32 or f16 zero addends. With f32 0x00801002 and f16 0x3bff, nearest gives 0x00800000 at IEEE=0 and IEEE=1; main gives zero. The adjacent f32 values 0x00801001 and 0x00801003 give zero and 0x00800001. At IEEE=0, the tiny boundary also follows all four f32 round modes. Input conversion and source denormal handling are unchanged.

The f32-source hardware table has 32 rows times 8 instructions; 220 of the 256 cells are tiny products. To nearest, main differs from the hardware on 120 of them; in +inf and -inf on 74. With this change all 220 tiny-product cells match in every round mode. Toward zero, main's tiny-product cells already matched. Normal products and signed-zero cases outside this path still round to nearest in the other modes, as before (8 to 11 cells per directed mode, unchanged by this PR).

The TechnicalDebt line on f32 denormals recorded this gap (db491f0c); it now states the after-rounding rule instead, and that legacy mad/mac still use the exact product.

Tested

CachyOS Linux, GCC, NVIDIA RTX 4070 Ti (615.78.08), Radeon 610M on RADV and lavapipe (Mesa 26.2.4). Tested on base db343a934 plus this change. After the rebase on 57f96fd2b, the 22 shader and f32 denormal flush tests pass again on NVIDIA and RADV, and the flush test on lavapipe.

  • agc_driver_f32_denormal_flush gets a second kernel with the instructions above on 32 rows. Each is checked against hardware in no float mode, 0xc0 and 0x00. v_mul_f32 with and without a negated source is also checked with round modes +inf, -inf and zero. The original f32-source regression failed without the fix (lane 0 no float mode v_mul_f32 v10, v4, v5 is 0x00000000, expected 0x00800000). The current test also checks mixed sources and passes on both GPUs; its new negative-control failure is described below.
  • The same kernel also runs v_mad_legacy_f32 and v_mac_legacy_f32 on the 32 rows, in all six modes. They give the same bits as on main; with the after-rounding rule applied to them they would not (lane 0 no float mode v_mad_legacy_f32 v18, v4, v5, v6 is 0x00800000, expected 0x00000000).
  • Fresh full CTest runs, 701 registered tests per driver: NVIDIA 696 passed, 4 skipped, 1 known DCC first-write failure; RADV 694 passed, 7 skipped, no failures; lavapipe 669 passed, 31 skipped, 1 known f64-subnormal failure. These failures reproduce with the unchanged upstream shader control and are outside this change. The shader/AGC/vector subset is 268 passed plus DCC on NVIDIA, 269 passed on RADV, and 241 passed, 27 skipped plus f64 on lavapipe. An existing lavapipe flat-store test took 41.71 s; the extended f32 test took 1.76 s, 0.70 s and 1.10 s respectively.
  • The new mixed kernel checks 16 rows across eight forms, with f16 in either multiplicand slot, both halves, both signs and f16 zero addends. Nearest checks every cell at IEEE=0/1 and with no known mode; directed checks pin only the tiny-product path. The extended test passes on all three drivers. The upstream-shader control fails on the exact mixed review row.
  • tools/check_conventions.py --base origin/main and git diff --check pass.
  • Not tested: a title; legacy mad/mac on gfx1010/gfx1013 hardware at this boundary. Normal (non-tiny) products in round modes other than nearest are unchanged. They are still rounded to nearest, as before.

Checklist

  • Based on current main
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4812703376 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2839). Originally posted by [CouchRiv](https://github.com/CouchRiv) on 2026-10-10T16:24:49Z. --- ### What With f32 denormals flushed (FLOAT_MODE 0xc0, the usual one), `v_mul_f32 v0, 0x3f7ffffe, v1` with `v1 = 0x00800001` gives `0x00000000`. RDNA2 gives `0x00800000`. The exact product is 2^-126 * (1 - 2^-46). It is below 2^-126, but rounded to 24 bits it is exactly 2^-126. The tiny-product check from #1850 tests the exact product (tininess before rounding), so it flushes it. The hardware tests the product rounded to 24 bits with an unbounded exponent, in the shader's f32 round mode (tininess after rounding). `flushTinyProduct` now flushes only when the rounded product is below 2^-126. A product that rounds up to 2^-126 gives 2^-126 with the product's sign. This needs one more 32-bit multiply (the low half of the significand product) and is settled for the FLOAT_MODE round mode (bits 1:0) at translation time. Everything else stays the same: callers, the nonzero-addend rule, #2020's constant-factor shortcuts (a power-of-two factor gives an exact product, so it skips the rounding check as well as the multiply-high), and the products themselves, which are still rounded to nearest even. `v_mad_legacy_f32` and `v_mac_legacy_f32` keep the exact-product check: on the console they round the product separately, and that encoding is not measured at this boundary (RDNA2 runs a fused form of it). Measured on RDNA2 (gfx1036, Radeon 610M) with `tools/hw-oracle`, wave32, DX10_CLAMP=1, f32 denormals flushed. To nearest it was measured at IEEE=0 and IEEE=1 (same bits), and the other round modes at IEEE=0. Products are 2^-126 * (1 - D/2^47). At 24 bits, D < 2^22 rounds up to 2^-126 to nearest and D = 2^22 is a tie. Rounding away from zero (+inf for a positive product, -inf for a negative one) rounds up any D < 2^23: | x * y | D | nearest | +inf | -inf | zero | `main`, nearest | |---|---|---|---|---|---|---| | `0x00800001 * 0x3f7ffffe` | 2 | `0x00800000` | `0x00800000` | `0x00000000` | `0x00000000` | `0x00000000` | | `0x80800001 * 0x3f7ffffe` | 2 | `0x80800000` | `0x80000000` | `0x80800000` | `0x80000000` | `0x80000000` | | `0x008003e6 * 0x3f7ff834` | 1992008 | `0x00800000` | `0x00800000` | `0x00000000` | `0x00000000` | `0x00000000` | | `0x008005a8 * 0x3f7ff4b0` | 4193408 | `0x00800000` | `0x00800000` | `0x00000000` | `0x00000000` | `0x00000000` | | `0x00f80000 * 0x3f042108` | 2^22 (tie) | `0x00800000` | `0x00800000` | `0x00000000` | `0x00000000` | `0x00000000` | | `0x008005a9 * 0x3f7ff4ae` | 4199202 | `0x00000000` | `0x00800000` | `0x00000000` | `0x00000000` | `0x00000000` | | `0x00800f95 * 0x3f7fe0d9` | 6646451 | `0x00000000` | `0x00800000` | `0x00000000` | `0x00000000` | `0x00000000` | | `0x00800001 * 0x3f7ffffd` | 8388611 | `0x00000000` | `0x00000000` | `0x00000000` | `0x00000000` | `0x00000000` | | `0x00ffffff * 0x3f000000` | 2^23 (exact) | `0x00000000` | `0x00000000` | `0x00000000` | `0x00000000` | `0x00000000` | `v_mul_f32`, `v_mul_legacy_f32`, `v_fma_f32`, `v_fmac_f32`, `v_fmamk_f32`, `v_fmaak_f32` and `v_fma_mix_f32` with all-f32 sources with a ±0 addend give the same bits when they evaluate the same tiny product. `v_mullit_f32`, which uses the same check since #2046, does too: on gfx1036 it gives the same bits as `v_mul_f32` on all 16 rows measured. The 6646451 row rules out "round to a denormal, then flush": with denormals kept, it gives `0x00800000`. Mixed f16/f32 `v_fma_mix_f32` uses the same after-rounding boundary. Fresh measurements on the same gfx1036 GPU cover f16 in either multiplicand slot, low and high half selection, both product signs, and f32 or f16 zero addends. With f32 `0x00801002` and f16 `0x3bff`, nearest gives `0x00800000` at IEEE=0 and IEEE=1; `main` gives zero. The adjacent f32 values `0x00801001` and `0x00801003` give zero and `0x00800001`. At IEEE=0, the tiny boundary also follows all four f32 round modes. Input conversion and source denormal handling are unchanged. The f32-source hardware table has 32 rows times 8 instructions; 220 of the 256 cells are tiny products. To nearest, `main` differs from the hardware on 120 of them; in +inf and -inf on 74. With this change all 220 tiny-product cells match in every round mode. Toward zero, `main`'s tiny-product cells already matched. Normal products and signed-zero cases outside this path still round to nearest in the other modes, as before (8 to 11 cells per directed mode, unchanged by this PR). The TechnicalDebt line on f32 denormals recorded this gap (db491f0c); it now states the after-rounding rule instead, and that legacy mad/mac still use the exact product. ### Tested CachyOS Linux, GCC, NVIDIA RTX 4070 Ti (615.78.08), Radeon 610M on RADV and lavapipe (Mesa 26.2.4). Tested on base db343a934 plus this change. After the rebase on 57f96fd2b, the 22 shader and f32 denormal flush tests pass again on NVIDIA and RADV, and the flush test on lavapipe. - `agc_driver_f32_denormal_flush` gets a second kernel with the instructions above on 32 rows. Each is checked against hardware in no float mode, 0xc0 and 0x00. `v_mul_f32` with and without a negated source is also checked with round modes +inf, -inf and zero. The original f32-source regression failed without the fix (`lane 0 no float mode v_mul_f32 v10, v4, v5 is 0x00000000, expected 0x00800000`). The current test also checks mixed sources and passes on both GPUs; its new negative-control failure is described below. - The same kernel also runs `v_mad_legacy_f32` and `v_mac_legacy_f32` on the 32 rows, in all six modes. They give the same bits as on `main`; with the after-rounding rule applied to them they would not (`lane 0 no float mode v_mad_legacy_f32 v18, v4, v5, v6 is 0x00800000, expected 0x00000000`). - Fresh full CTest runs, 701 registered tests per driver: NVIDIA 696 passed, 4 skipped, 1 known DCC first-write failure; RADV 694 passed, 7 skipped, no failures; lavapipe 669 passed, 31 skipped, 1 known f64-subnormal failure. These failures reproduce with the unchanged upstream shader control and are outside this change. The shader/AGC/vector subset is 268 passed plus DCC on NVIDIA, 269 passed on RADV, and 241 passed, 27 skipped plus f64 on lavapipe. An existing lavapipe flat-store test took 41.71 s; the extended f32 test took 1.76 s, 0.70 s and 1.10 s respectively. - The new mixed kernel checks 16 rows across eight forms, with f16 in either multiplicand slot, both halves, both signs and f16 zero addends. Nearest checks every cell at IEEE=0/1 and with no known mode; directed checks pin only the tiny-product path. The extended test passes on all three drivers. The upstream-shader control fails on the exact mixed review row. - `tools/check_conventions.py --base origin/main` and `git diff --check` pass. - Not tested: a title; legacy mad/mac on gfx1010/gfx1013 hardware at this boundary. Normal (non-tiny) products in round modes other than nearest are unchanged. They are still rounded to nearest, as before. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main` - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] AI-assisted: yes
fma-rc commented 2026-10-10 17:08:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-10T17:08:43Z.


Independent check on a Radeon 610M, at rows the PR's tests do not have: the exact nearest-even tie, the directed-mode threshold, and the directed modes on the product forms other than v_mul_f32. The PR gives the hardware bits on all of them.

Setup: PR head d59efa47 merged onto main 57f96fd2. Arch Linux, GCC 16.2.1, Release. Hardware rows from tools/hw-oracle on a Radeon 610M (gfx1036, RDNA2), DX10_CLAMP=1, f32 denormals flushed, f16 denormals kept; each round mode at IEEE=0 and IEEE=1, wave32 and wave64, same bits in all four. Recompiler runs on an RTX 5080 (615.78.08) and on the Radeon 610M (RADV, Mesa 26.1.4), FLOAT_MODE 0xc0 | round.

Hardware. Each row was run as v_mul_f32, v_mul_legacy_f32, v_mullit_f32 (third operand 1.0), v_fma_f32 with a +0 addend and v_fma_f32 with a -0 addend. The five forms gave the same bits in every cell, so the table has one value per cell. P is the 48-bit significand product.

a * b P nearest +inf -inf zero
3f042108 * 00f80000 2^47 - 2^22 (tie) 00800000 00800000 00000000 00000000
bf042108 * 00f80000 80800000 80000000 80800000 80000000
3f04796c * 00f75a87 12 below the tie 00000000 00800000 00000000 00000000
bf04796c * 00f75a87 80000000 80000000 80800000 80000000
3f7fffff * 00800000 2^47 - 2^23 (exact) 00000000 00000000 00000000 00000000
bf7fffff * 00800000 80000000 80000000 80000000 80000000
3f001802 * 00ffd004 2^47 - 2^23 + 8 00000000 00800000 00000000 00000000
bf001802 * 00ffd004 80000000 80000000 80800000 80000000
3f000001 * 00fffffe 2^47 - 2 00800000 00800000 00000000 00000000
bf000001 * 00fffffe 80800000 80000000 80800000 80000000
3effffff * 00ffffff 2^48 - 2^25 + 1, one exponent lower 00000000 00000000 00000000 00000000
beffffff * 00ffffff 80000000 80000000 80000000 80000000

So the tie goes to 2^-126 to nearest, and a product that is exactly 2^-126 * (1 - 2^-24) stays flushed in every mode.

Recompiler against those bits (temporary test: 12 rows, 5 forms, 4 round modes, 240 results):

Build RTX 5080 RADV, Radeon 610M
main 57f96fd2 60 of 240 differ 60 of 240 differ
main + this PR 0 of 240 differ 0 of 240 differ

On main every difference is a 0x00000000 / 0x80000000 where the hardware gives 2^-126 with the product's sign.

The PR's own tests (ctest -R 'denormal|float|f32|mul|mad|fma', 30 tests) pass on both devices.

Not measured: v_mad_legacy_f32 / v_mac_legacy_f32, v_fmac_f32, v_fmamk_f32, v_fmaak_f32 and v_fma_mix_f32 at these rows; products at or above 2^-126 in the directed modes.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6100063341 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2839#issuecomment-6100063341). Originally posted by [fma-rc](https://github.com/fma-rc) on 2026-10-10T17:08:43Z. --- Independent check on a Radeon 610M, at rows the PR's tests do not have: the exact nearest-even tie, the directed-mode threshold, and the directed modes on the product forms other than `v_mul_f32`. The PR gives the hardware bits on all of them. **Setup:** PR head d59efa47 merged onto `main` 57f96fd2. Arch Linux, GCC 16.2.1, Release. Hardware rows from `tools/hw-oracle` on a Radeon 610M (gfx1036, RDNA2), DX10_CLAMP=1, f32 denormals flushed, f16 denormals kept; each round mode at IEEE=0 and IEEE=1, wave32 and wave64, same bits in all four. Recompiler runs on an RTX 5080 (615.78.08) and on the Radeon 610M (RADV, Mesa 26.1.4), FLOAT_MODE `0xc0 | round`. **Hardware.** Each row was run as `v_mul_f32`, `v_mul_legacy_f32`, `v_mullit_f32` (third operand 1.0), `v_fma_f32` with a `+0` addend and `v_fma_f32` with a `-0` addend. The five forms gave the same bits in every cell, so the table has one value per cell. P is the 48-bit significand product. | a * b | P | nearest | +inf | -inf | zero | |---|---|---|---|---|---| | `3f042108 * 00f80000` | 2^47 - 2^22 (tie) | `00800000` | `00800000` | `00000000` | `00000000` | | `bf042108 * 00f80000` | | `80800000` | `80000000` | `80800000` | `80000000` | | `3f04796c * 00f75a87` | 12 below the tie | `00000000` | `00800000` | `00000000` | `00000000` | | `bf04796c * 00f75a87` | | `80000000` | `80000000` | `80800000` | `80000000` | | `3f7fffff * 00800000` | 2^47 - 2^23 (exact) | `00000000` | `00000000` | `00000000` | `00000000` | | `bf7fffff * 00800000` | | `80000000` | `80000000` | `80000000` | `80000000` | | `3f001802 * 00ffd004` | 2^47 - 2^23 + 8 | `00000000` | `00800000` | `00000000` | `00000000` | | `bf001802 * 00ffd004` | | `80000000` | `80000000` | `80800000` | `80000000` | | `3f000001 * 00fffffe` | 2^47 - 2 | `00800000` | `00800000` | `00000000` | `00000000` | | `bf000001 * 00fffffe` | | `80800000` | `80000000` | `80800000` | `80000000` | | `3effffff * 00ffffff` | 2^48 - 2^25 + 1, one exponent lower | `00000000` | `00000000` | `00000000` | `00000000` | | `beffffff * 00ffffff` | | `80000000` | `80000000` | `80000000` | `80000000` | So the tie goes to 2^-126 to nearest, and a product that is exactly 2^-126 * (1 - 2^-24) stays flushed in every mode. **Recompiler against those bits** (temporary test: 12 rows, 5 forms, 4 round modes, 240 results): | Build | RTX 5080 | RADV, Radeon 610M | |---|---|---| | `main` 57f96fd2 | 60 of 240 differ | 60 of 240 differ | | `main` + this PR | 0 of 240 differ | 0 of 240 differ | On `main` every difference is a `0x00000000` / `0x80000000` where the hardware gives 2^-126 with the product's sign. The PR's own tests (`ctest -R 'denormal|float|f32|mul|mad|fma'`, 30 tests) pass on both devices. **Not measured:** `v_mad_legacy_f32` / `v_mac_legacy_f32`, `v_fmac_f32`, `v_fmamk_f32`, `v_fmaak_f32` and `v_fma_mix_f32` at these rows; products at or above 2^-126 in the directed modes. AI-assisted: yes
github-actions[bot] commented 2026-10-10 22:16:09 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-10T22:16:09Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
#3098 core/shader/recompiler/Translation/src/TranslationContext/OperandAccess.cpp L162-168
docs/dev/TechnicalDebt.md L405
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6102757920 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2839#issuecomment-6102757920). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T22:16:09Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | #3098 | `core/shader/recompiler/Translation/src/TranslationContext/OperandAccess.cpp` [L162-168](https://github.com/boykopovar/AnyPS5/blob/91b13413199e6eff2743ed743325a3a8578afa06/core/shader/recompiler/Translation/src/TranslationContext/OperandAccess.cpp#L162-L168)<br>`docs/dev/TechnicalDebt.md` [L405](https://github.com/boykopovar/AnyPS5/blob/91b13413199e6eff2743ed743325a3a8578afa06/docs/dev/TechnicalDebt.md#L405) | | |
adriadam10 commented 2026-10-10 22:57:18 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-10T22:57:18Z.


Checked on Linux (merged onto current main): build + ctest green for the AgcDriver/Agc scope, agc_driver_f32_denormal_flush fails without the OperandAccess.cpp change and passes with it, also on CI's lavapipe. HW oracle on RDNA2 (gfx1035, IEEE=0, f32 denormals flushed, all four round modes): 706 rows around the 2^-126 boundary (ties, D = 2^22 / 2^23, several exponent splits, both signs, ±0 addends, v_fma_mix_f32 with f16 in either slot) × 9 forms (v_mul, v_mul_legacy, v_mullit, v_fma, v_fmac, v_fma_mix f32 and mixed, negated source), 25416 cells: the PR's rule matches the hardware on every one. Also confirmed independently by @fma-rc on gfx1036, NVIDIA and RADV. Merging.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6103081170 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2839#issuecomment-6103081170). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-10T22:57:18Z. --- Checked on Linux (merged onto current `main`): build + ctest green for the AgcDriver/Agc scope, `agc_driver_f32_denormal_flush` fails without the `OperandAccess.cpp` change and passes with it, also on CI's lavapipe. HW oracle on RDNA2 (gfx1035, IEEE=0, f32 denormals flushed, all four round modes): 706 rows around the 2^-126 boundary (ties, D = 2^22 / 2^23, several exponent splits, both signs, ±0 addends, `v_fma_mix_f32` with f16 in either slot) × 9 forms (`v_mul`, `v_mul_legacy`, `v_mullit`, `v_fma`, `v_fmac`, `v_fma_mix` f32 and mixed, negated source), 25416 cells: the PR's rule matches the hardware on every one. Also confirmed independently by @fma-rc on gfx1036, NVIDIA and RADV. Merging.
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!2839
No description provided.