nir+vtn: vec8+vec16 support
authorRob Clark <robdclark@gmail.com>
Sat, 9 Mar 2019 16:17:55 +0000 (17:17 +0100)
committerKarol Herbst <karolherbst@gmail.com>
Sat, 21 Dec 2019 11:00:17 +0000 (11:00 +0000)
commita8ec4082a41830cf67a4fd405402fd2d820722fd
treee2fc5c64508ce10f2402a7524eb65cb7a53e1199
parentb35e583c17c647dd5605220ef0e8db28b879aae0
nir+vtn: vec8+vec16 support

This introduces new vec8 and vec16 instructions (which are the only
instructions taking more than 4 sources), in order to construct 8 and 16
component vectors.

In order to avoid fixing up the non-autogenerated nir_build_alu() sites
and making them pass 16 src args for the benefit of the two instructions
that take more than 4 srcs (ie vec8 and vec16), nir_build_alu() is has
nir_build_alu_tail() split out and re-used by nir_build_alu2() (which is
used for the > 4 src args case).

v2 (Karol Herbst):
  use nir_build_alu2 for vec8 and vec16
  use python's array multiplication syntax
  add nir_op_vec helper
  simplify nir_vec
  nir_build_alu_tail -> nir_builder_alu_instr_finish_and_insert
  use nir_build_alu for opcodes with <= 4 sources
v3 (Karol Herbst):
  fix nir_serialize
v4 (Dave Airlie):
  fix serialization of glsl_type
  handle vec8/16 in lowering of bools
v5 (Karol Herbst):
  fix load store vectorizer

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
14 files changed:
src/compiler/glsl_types.cpp
src/compiler/nir/nir.h
src/compiler/nir/nir_builder.h
src/compiler/nir/nir_builder_opcodes_h.py
src/compiler/nir/nir_constant_expressions.py
src/compiler/nir/nir_lower_alu_to_scalar.c
src/compiler/nir/nir_lower_bool_to_float.c
src/compiler/nir/nir_lower_bool_to_int32.c
src/compiler/nir/nir_opcodes.py
src/compiler/nir/nir_opt_load_store_vectorize.c
src/compiler/nir/nir_print.c
src/compiler/nir/nir_search.c
src/compiler/nir/nir_validate.c
src/compiler/spirv/spirv_to_nir.c