nir: define NIR_ALU_MAX_INPUTS

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11172>
This commit is contained in:
Hoe Hao Cheng 2021-06-04 02:48:59 +08:00 committed by Marge Bot
parent d6d7421e98
commit 90a5fef85c

View file

@ -1338,6 +1338,11 @@ typedef enum {
NIR_OP_IS_ASSOCIATIVE = (1 << 1),
} nir_op_algebraic_property;
/* vec16 is the widest ALU op in NIR, making the max number of input of ALU
* instructions to be the same as NIR_MAX_VEC_COMPONENTS.
*/
#define NIR_ALU_MAX_INPUTS NIR_MAX_VEC_COMPONENTS
typedef struct {
const char *name;
@ -1372,14 +1377,14 @@ typedef struct {
/**
* The number of components in each input
*/
uint8_t input_sizes[NIR_MAX_VEC_COMPONENTS];
uint8_t input_sizes[NIR_ALU_MAX_INPUTS];
/**
* The type of vector that each input takes. Note that negate and
* absolute value are only allowed on inputs with int or float type and
* behave differently on the two.
*/
nir_alu_type input_types[NIR_MAX_VEC_COMPONENTS];
nir_alu_type input_types[NIR_ALU_MAX_INPUTS];
nir_op_algebraic_property algebraic_properties;