xshader: v_med3_f32 with a NaN operand is MIN3 with the NaN ignored #203
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
library
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/omonkeyz--xbox-emulator!203
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/203/head"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@QuentinDanblon on GitHub · 2026-11-23 01:02 UTC · original
QuentinDanblon:pr/hw-med3→main· +17 −1 · 2 files · 1 commits · closed without mergingLibrary / area: tombox-xshader (
v_med3_f32)Exports changed (exports.txt rows): none
Source of the behaviour: RDNA2 ISA,
V_MED3_F32(if any operand is a NaN, the result is MIN3 of the three, which drops the NaN), confirmed by results an AMD Radeon RX 6800 (gfx1030) returned, published in the comments of the Leonida project's GPU test programs (GPL-3.0). Facts only, no code copied; encodings fromllvm-mc -mcpu=gfx1013. The Leonida line ofTHIRD_PARTY/CREDITSalready coverstests/exec_vop/leonida.rs.Part of the split of #152: second group of translator fixes. Based on
c2a3522, 2 files, +17 / -1.v_med3_f32with a NaN operand:med3(NaN, 7, 5)is 5 (was 7),med3(NaN, 3.5, -2.5)is -2.5 (was 3.5).Test
leonida_nan_and_fract: 8 measured cases. Onc2a3522without the fix the twov_med3_f32cases fail; thev_fract_f32,v_fract_f16,v_min_f32,v_max_f32,v_min3_f32andv_max3_f32cases already pass.Results
WARP,
--release, this branch alone onc2a3522:cargo test -p tombox-xshader --test exec -- leonida: 4 passed, 0 failed, 1 ignored.v_med3_f32, SMEM) merged together onc2a3522,cargo test -p tombox-xshader, all targets: 0 failed. exec 115 passed (2 ignored), lib 90, mesh 26, opcodes 24, synthetic 24, isa_table 3, linkage 3, mixed_table 3, gcn_dims 3.isa_sweep: 541 mnemonics, 530 pass, 0 fail, 11 known WARP deviations.2eda8b0without conflict (git merge-tree); it was not rerun there.Hardware: not rerun on this base, the GPU of my machine is busy for now. The same change passed on an RTX 5090 in #152 (
2f1cfd0onf10db75), and MiguelMatMar ran that branch on an RTX 40-series (results in #152). I will post a hardware run of this branch when the card is free.No comment lines added (PR gate: 2 files checked, 0 problems). Not run against a title.
cargo test -p tombox-xshaderpasses on WARPmissingwith a note🤖 Generated with Claude Code
@omonkeyz on GitHub · 2026-11-23 01:38 UTC · original
Applied in
a7f858d(merged in24e6c10) with your authorship kept, thanks. The trailing comments on the new test vectors were dropped inf04f768(the project keeps code comment-free).Pull request closed