Repository navigation
fix(shader): flush v_mac_legacy_f32 denormals as measured on gfx1010 - #1290
Merged
adriadam10 merged 1 commit intoOct 10, 2026
Merged
Conversation
SirDarky
force-pushed
the
fix/shader-mac-legacy-denormals
branch
from
October 8, 2026 03:38
0f99e17 to
bec780a
Compare
9 tasks done
9 tasks done
SirDarky
force-pushed
the
fix/shader-mac-legacy-denormals
branch
from
October 10, 2026 04:16
bec780a to
3a053b3
Compare
This was referenced Oct 10, 2026
Collaborator
|
#1281 is merged, so this now conflicts in |
VOP2 0x06 measured the same as VOP3 0x140 on gfx1010 (RX 5700 XT) in wave32 and wave64, IEEE 0 and 1 and f32 denormal modes 0 to 3: the product is rounded before the add, f32 denormal sources, product and result are flushed in every mode, and a zero factor gives a +0 product. It now shares the v_mad_legacy_f32 translation with the accumulator as the addend, and f32DenormalFlushFor returns 3 for it as well. A new execution test pins the measured results of its VOP2 and VOP3 forms. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Collaborator
|
Rebased onto main as requested by @oneandonlydean: dropped the already merged #1281 commit, resolved the conflicts in Checked: build and the Agc/AgcDriver ctest scope on the rebased tree ( |
adriadam10
force-pushed
the
fix/shader-mac-legacy-denormals
branch
from
October 10, 2026 09:05
3a053b3 to
683ea37
Compare
9 tasks done
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
v_mac_legacy_f32(VOP2 0x06, and its VOP3 form 0x106) measured the same as VOP3 0x140 on gfx1010 (#1281): the product is rounded before the add, f32 denormal sources, product and result are flushed to a zero of the same sign in every f32 denormal mode and both IEEE modes, and a zero factor gives a +0 product. NaN results follow the same rule on the bits. Before this change,mainrounded the product but left denormals and NaN bits to the driver, and TechnicalDebt listed it as not covered.It now shares
vFmaLegacyF32withv_mad_legacy_f32, with the accumulator as the addend.f32DenormalFlushForreturns 3 forVMacLegacyF32too.vMulLegacyF32loses itsaccumulatepath, since onlyv_mul_legacy_f32uses it now. That instruction is unchanged and still follows theFLOAT_MODEmodel.The new
MacLegacy.cppexecution test runs four encodings (VOP2, VOP3-src0, VOP3|src0| -|src1|, VOP2 with inline0) on the 32 rows ofFmaLegacy.cpp. It pins the measured results and compares NaN bits exactly.Float16Misc.cppskips its legacy columns for denormal rows, so it did not cover this. TechnicalDebt: the legacy-mad entry, the NaN line and the f32-denormal line now includev_mac_legacy_f32.Source of the semantics: measured on hardware, an AMD Radeon RX 5700 XT (gfx1010), with
tools/hw-oracle/template.sunchanged. It was assembled by the AMD Windows driver'samd_comgr_2.dlland launched through itsamdhip64_6.dllinstead oforacle.cand ROCr, as in #1281. 32 rows × 4 encodings, wave32 and wave64, IEEE 0 and 1, f32 denormal modes 0 to 3: all 16 combinations agree, except the signaling NaN rows, which are quieted only with IEEE=1. The raw output is thevop2_0x06part of the attachment in #1281.Tested
Windows 11, MinGW-w64 GCC 15.2.0 (WinLibs r7), AMD Radeon RX 5700 XT, CI configure flags, full
ctest --output-on-failure --timeout 120onmainc963432 plus #1281 and this change: 570 of 574 pass.agc_driver_pixel_interlock,agc_driver_sdwa_float_selectorsandagc_driver_sdwa_ldexp_f16fail on unmodifiedmainon this GPU (see #1281).video_out_flip_controlsexited with 0xc0000374 once; rerun six times, it was skipped five times and crashed once, so it is intermittent and unrelated.agc_driver_mac_legacy,agc_driver_fma_legacy,agc_driver_float16_misc,agc_driver_dpp_no_formandvector_mad_legacypass. With the translation from fix(shader): round the v_mad_legacy_f32 product before the add #1281 alone,agc_driver_mac_legacyfails (lane 26 (0x00000001, 0x3f800000, 0x80000000) v_mac_legacy_f32_e64 -src0 is 0x80000000, expected 0x00000000).Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code