diff --git a/.pick_status.json b/.pick_status.json index 9a948d6f4cb..1c2c6ca5654 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -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 diff --git a/src/panfrost/compiler/bifrost/bifrost_nir_algebraic.py b/src/panfrost/compiler/bifrost/bifrost_nir_algebraic.py index 27d0a400a52..3a5ded6b8ce 100644 --- a/src/panfrost/compiler/bifrost/bifrost_nir_algebraic.py +++ b/src/panfrost/compiler/bifrost/bifrost_nir_algebraic.py @@ -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)), ]