diff options
| author | Luiz Neves <luizgustavobenicio@gmail.com> | 2026-11-21 18:41:30 -0300 |
|---|---|---|
| committer | Luiz Neves <luizgustavobenicio@gmail.com> | 2026-11-21 18:41:30 -0300 |
| commit | eef6f1429740dea1c2b19d32134cfe0613815f6c (patch) | |
| tree | e3447f3c48748b34d5389750c066282fd26f6627 /runtime/src/tls_host.cpp | |
| parent | 4e390e0871d7265e629b51aca8ff99a15a6a6845 (diff) | |
Translator: keep bitfield extracts inside 32 bits (v_bfe, s_bfe)
v_bfe_u32/v_bfe_i32 and s_bfe_u32/s_bfe_i32 passed offset and width straight to
OpBitFieldU/SExtract. SPIR-V leaves offset + count > 32 undefined, and that
happens for any field that runs past bit 31 (v_bfe: both are 5 bits; s_bfe: the
width is 7 bits). The width is now cut to 32 - offset, so the field stops at
bit 31: zero-filled for the unsigned extract, sign-filled for the signed one.
That is the value LLVM's constantFoldBFE (AMDGPUISelLowering.cpp) gives,
Src0 >> Offset.
test_alu_bfe.py: the i32 reference shifts arithmetically, the sweep no longer
skips offset + width > 32, and new tests cover such fields and s_bfe with
widths up to 127. test_mutations.py follows the renamed width operand.
Diffstat (limited to 'runtime/src/tls_host.cpp')
0 files changed, 0 insertions, 0 deletions