nir: Add a bit_size to nir_register and nir_ssa_def
This really hacky commit adds a bit size to registers and SSA values. It also adds rules in the validator to validate that they do the right things. It's still an open question as to whether or not we want a bit_size in nir_alu_instr or if we just want to let it inherit from the destination. I'm inclined to just let it inherit from the destination. A similar question needs to be asked about intrinsics. v2 (Connor): - Relax validation: comparisons have explicit destination sizes and implicit source sizes. v3 (Sam): - Use helpers to get size and base types of nir_alu_type enum. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
This commit is contained in:

committed by
Samuel Iglesias Gonsálvez

parent
3d37de930d
commit
e172dbe5d2
@@ -345,6 +345,9 @@ typedef struct nir_register {
|
||||
unsigned num_components; /** < number of vector components */
|
||||
unsigned num_array_elems; /** < size of array (0 for no array) */
|
||||
|
||||
/* The bit-size of each channel; must be one of 8, 16, 32, or 64 */
|
||||
uint8_t bit_size;
|
||||
|
||||
/** generic register index. */
|
||||
unsigned index;
|
||||
|
||||
@@ -452,6 +455,9 @@ typedef struct nir_ssa_def {
|
||||
struct list_head if_uses;
|
||||
|
||||
uint8_t num_components;
|
||||
|
||||
/* The bit-size of each channel; must be one of 8, 16, 32, or 64 */
|
||||
uint8_t bit_size;
|
||||
} nir_ssa_def;
|
||||
|
||||
struct nir_src;
|
||||
|
Reference in New Issue
Block a user