pan/bi: Be more careful about bit sizes in b2f lowering

Fixes: 21bdee7bcc ("pan/bi: Switch to lower_bool_to_bitsize")
Reviewed-by: Christoph Pillmayer <christoph.pillmayer@arm.com>
(cherry picked from commit 08c437f644)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40359>
This commit is contained in:
Faith Ekstrand 2026-03-09 16:27:42 -04:00 committed by Eric Engestrom
parent 9c2b19219a
commit 7054ea6d45
2 changed files with 8 additions and 3 deletions

View file

@ -474,7 +474,7 @@
"description": "pan/bi: Be more careful about bit sizes in b2f lowering",
"nominated": true,
"nomination_type": 2,
"resolution": 0,
"resolution": 1,
"main_sha": null,
"because_sha": "21bdee7bccd2b9b4b4f3b8b2eefce0466fc4b621",
"notes": null

View file

@ -112,9 +112,14 @@ for cond in ['ilt', 'ige', 'ieq', 'ine', 'ult', 'uge']:
# automatically. Do so explicitly. (The more specific pattern must be first.)
for bsz in [8, 16, 32]:
for fsz in [16, 32]:
if bsz == fsz:
a_fsz = 'a'
else:
a_fsz = (f'i2i{fsz}', a)
algebraic_late += [
((f'b2f{fsz}', ('inot', f'a@{bsz}')), (f'b{bsz}csel', a, 0.0, 1.0)),
((f'b2f{fsz}', f'a@{bsz}'), (f'b{bsz}csel', a, 1.0, 0.0)),
((f'b2f{fsz}', ('inot', f'a@{bsz}')), (f'b{fsz}csel', a_fsz, 0.0, 1.0)),
((f'b2f{fsz}', f'a@{bsz}'), (f'b{fsz}csel', a_fsz, 1.0, 0.0)),
]