nir: Fix lowering of bitfield_insert to shifts.
authorEric Anholt <eric@anholt.net>
Thu, 27 Jun 2019 21:29:37 +0000 (14:29 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 28 Jun 2019 23:38:23 +0000 (16:38 -0700)
commit8fd8964302af652f7de14923111ca9b15b8d2b48
tree1ed8677d4c64389532c4cc759702bcdf80cd0189
parent97c2c4546ca5d7c17f039dde9a6fd5957fb2364a
nir: Fix lowering of bitfield_insert to shifts.

The bfi/bfm behavior change replaced the bfi/bfm usage in
lower_bitfield_insert_to_shifts with actual shifts like the name says,
but it failed to handle the offset=0, bits==32 case in the new
lowering.

v2: Use 31 < bits instead of bits == 32, to get the 31 < (iand bits,
    31) -> false optimization.

Fixes regressions in dEQP-GLES31.*bitfield_insert* on freedreno.

Fixes: 165b7f3a4487 ("nir: define behavior of nir_op_bfm and nir_op_u/ibfe according to SM5 spec.")
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
src/compiler/nir/nir_opt_algebraic.py