nir/constant_expressions: Don't switch on bit size when not needed
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 14 Mar 2017 17:31:21 +0000 (10:31 -0700)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 30 Mar 2017 18:34:45 +0000 (11:34 -0700)
commit28e41506a6ee0631cf6ca04891dcb3adeff82f60
treef66cedb05253861b48e97deeb935faf5ad15c950
parentb69b44d22203d9370ee8d750279e955d066a2bf3
nir/constant_expressions: Don't switch on bit size when not needed

For opcodes such as the nir_op_pack_64_2x32 for which all sources and
destinations have explicit sizes, the bit_size parameter to the evaluate
function is pointless and *should* do nothing.  Previously, we were
always switching on the bit_size and asserting if it isn't one of the
sizes in the list.  This generates way more code than needed and is a
bit cruel because it doesn't let us have a bit_size of zero on an ALU op
which shouldn't need a bit_size.

Reviewed-by: Eduardo Lima Mitev <elima@igalia.com>
src/compiler/nir/nir_constant_expressions.py