tombox-xshader: f32 omod only acts with IEEE 0 and f32 output denormals flushed (measured on RDNA2); fres() applies it under MODE 0xf0 #386
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#386
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@SchmashinPrunes on GitHub · 2026-11-25 17:34 UTC · original
Library / area: tombox-xshader, f32 VOP3 output modifiers (
fresinhlsl.rs) and the assumed initial MODE (mode::MODE_DEFAULT = 0xf0,PGM_RSRC1_ATempty).@omonkeyz, this needs a decision from you, so it's an issue rather than a PR.
Measurement
I ran the ISA sweep's f32 omod cases on RDNA2 silicon as raw kernels: a gfx1036 iGPU, Ryzen 5 9600X, ROCm/HIP. That's RDNA2, not gfx1013. The ops were
v_add/sub/subrev/mul/mul_legacy/min/max_f32withmul:2,mul:4anddiv:2, about 580 finite cases each, under every FP_DENORM f32 setting and both IEEE values:All seven ops show the same pattern. f32 omod acts only when IEEE = 0 and f32 output denormals are flushed (
(MODE & 0x220) == 0). It's the same rule #363 measured for f16, and the same condition LLVM uses before folding an omod (SIFoldOperands: IEEE off and FP32 denormals flushed).Why this is a decision
fres()applies f32 omod unconditionally. Under the translator's assumed MODE0xf0(f32 denormals kept), the hardware would ignore it. Gating it like f16 (hres_mode,& 0x280) would be correct for that MODE.PGM_RSRC1_ATis empty, so every title shader runs withMODE_DEFAULT = 0xf0. Gating f32 omod correctly under that MODE switches off every f32 omod in every title.0xf0is probably wrong for those shaders, at least for f32.Options I can see:
0xc0or similar) until PGM_RSRC1 is located. That changes how f32 denormals are treated in every title shader, so it needs your corpus runs.s_setreg), and keep applying omod otherwise, with anunknownsnote as the f16 path has.I can implement whichever you prefer. The silicon data and the sweep cases are ready for an exec test either way.
The other silicon mismatches (VOP3 op_sel on promoted ops,
v_cube*denormals,v_sat_pk_u8_i16) are in PR #385.🤖 Generated with Claude Code