nir/builder: Add iadd_imm and imul_imm helpers
authorJason Ekstrand <jason.ekstrand@intel.com>
Mon, 12 Nov 2018 21:58:18 +0000 (15:58 -0600)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 16 Nov 2018 01:59:27 +0000 (19:59 -0600)
commitb77d68b78e2bf623bf9ba3f28945cf2080185a9d
tree129ec21f92efd1dda3a795bfa5892318fff2c702
parent1f29f4db1e867357a119c0c7c34fb54dc27fb682
nir/builder: Add iadd_imm and imul_imm helpers

The pattern of adding or multiplying an integer by an immediate is
fairly common especially in deref chain handling.  This adds a helper
for it and uses it a few places.  The advantage to the helper is that
it automatically handles bit sizes for you.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
src/compiler/nir/nir_builder.h
src/compiler/nir/nir_lower_io.c
src/compiler/spirv/vtn_variables.c