docs: close the s_bfe width blocker from the ISA pseudocode and LLVM folding #178
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!178
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/178/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?
@iseaprojects on GitHub · 2026-11-22 18:24 UTC · original
iseaprojects:docs/s-bfe-width→main· +1 −1 · 1 files · 1 commits · closed without mergingLibrary / area:
docs/BLOCKERS.md(RDNA2 instructions held at yellow). No code change.Exports changed (exports.txt rows): none
Source of the behaviour: the blocker asked for one of two external references; both agree with the translator as it stands:
D.u = (S0.u >> S1.u[4:0]) & ((1 << S1.u[22:16]) - 1). The width field is 7 bits, so width 0 clears the result and width 32 masks all 32 bits, leaving the shift alone.AMDGPUISelLowering.cpp,constantFoldBFE: whenWidth + Offset >= 32it returnsSrc0 >> Offsetwith no mask, and only masks the narrower field.SIISelLowering.cpp,knownBitsForSBFE, treats a width of 32 or more as ill-formed.hlsl.rsalready lowers that rule:s_bfe_u32shifts whenwidth >= 32,tb_bfe_i32shifts whenwidth + offset >= 32, ands_bfe_*64clamp the width to 64.tests/isa_sweep/ops_s.rscovers widths 0, 1, 31, 32, 33, 63, 64, 65 and 127 with lane offsets, plus0xffffffff(offset 31, width 127).This entry is the only change: the note is replaced with the closure and its evidence. Nothing else in the section is touched;
v_cvt_normstays open because the ISA says only "supports rounding" for the(snorm)/(unorm)casts and does not settle .5 ties.Tests (Windows 11, GTX 1650, debug):
TOMBOX_SWEEP_FILTER=s_bfe cargo test -p tombox-xshader --test isa_sweep isa_sweep(WARP):s_bfe_u32,s_bfe_i32,s_bfe_u64,s_bfe_i64PASS, 11 cases and 11264 lanes each.TOMBOX_EXEC_HW=1 cargo test -p tombox-xshader --test isa_sweep isa_sweep(GTX 1650): 541 mnemonics, 541 pass, 0 fail, 0 known WARP deviations, 94 compiles, 15.1 s.No game or console files and no binaries included
No fake success; the two still-unconfirmed items in that section keep their notes
@omonkeyz on GitHub · 2026-11-22 18:28 UTC · original
Applied in
01a7018(merged in6ef1fea) with your authorship kept, thanks. I checked it against hlsl.rs on main:s_bfe_u32shifts without masking when the width is 32 or more,tb_bfe_i32shifts when width + offset is 32 or more, and width 0 gives 0. So the entry now matches the code.Pull request closed