diff --git a/src/compiler/nir/nir_algebraic.py b/src/compiler/nir/nir_algebraic.py index c9daccdc59c..47040d2b121 100644 --- a/src/compiler/nir/nir_algebraic.py +++ b/src/compiler/nir/nir_algebraic.py @@ -186,8 +186,8 @@ class Value(object): ${val.swizzle()}, % elif isinstance(val, Expression): ${'true' if val.inexact else 'false'}, ${'true' if val.exact else 'false'}, - ${val.comm_expr_idx}, ${val.comm_exprs}, ${val.c_opcode()}, + ${val.comm_expr_idx}, ${val.comm_exprs}, { ${', '.join(src.array_index for src in val.sources)} }, ${val.cond_index}, % endif diff --git a/src/compiler/nir/nir_search.h b/src/compiler/nir/nir_search.h index 421ee5f4662..67fe7d0a516 100644 --- a/src/compiler/nir/nir_search.h +++ b/src/compiler/nir/nir_search.h @@ -36,7 +36,7 @@ struct nir_builder; -typedef enum { +typedef enum PACKED { nir_search_value_expression, nir_search_value_variable, nir_search_value_constant, @@ -60,21 +60,21 @@ typedef struct { * - If bit_size < 0, then the value is constructed with the same bit size * as variable (-bit_size - 1). */ - int bit_size; + int8_t bit_size; } nir_search_value; typedef struct { nir_search_value value; /** The variable index; Must be less than NIR_SEARCH_MAX_VARIABLES */ - unsigned variable; + uint8_t variable : 7; /** Indicates that the given variable must be a constant * * This is only allowed in search expressions and indicates that the * given variable is only allowed to match constant values. */ - bool is_constant; + bool is_constant : 1; /** Indicates that the given variable must have a certain type * @@ -137,10 +137,13 @@ typedef struct { * value that does *not* have the exact bit set. If unset, the exact bit * on the SSA value is ignored. */ - bool inexact; + bool inexact : 1; /** In a replacement, requests that the instruction be marked exact. */ - bool exact; + bool exact : 1; + + /* One of nir_op or nir_search_op */ + uint16_t opcode : 14; /* Commutative expression index. This is assigned by opt_algebraic.py when * search structures are constructed and is a unique (to this structure) @@ -154,8 +157,6 @@ typedef struct { */ uint8_t comm_exprs; - /* One of nir_op or nir_search_op */ - uint16_t opcode; /* Index in table->values[] for the expression operands */ uint16_t srcs[4];