summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/nir_search.h
diff options
context:
space:
mode:
authorConnor Abbott <connor.w.abbott@intel.com>2015-08-14 11:45:30 -0700
committerSamuel Iglesias Gonsálvez <siglesias@igalia.com>2016-03-17 11:54:45 +0100
commit58fe7837b844da0c466a8573702d745f6f9975e6 (patch)
tree588b6f4a2ae3dae4a2cc61657be1b3d6f4307741 /src/compiler/nir/nir_search.h
parent3124ce699bb3844e793f00e00bfbea5c91744f90 (diff)
downloadexternal_mesa3d-58fe7837b844da0c466a8573702d745f6f9975e6.zip
external_mesa3d-58fe7837b844da0c466a8573702d745f6f9975e6.tar.gz
external_mesa3d-58fe7837b844da0c466a8573702d745f6f9975e6.tar.bz2
nir: propagate bitsize information in nir_search
When we replace an expresion we have to compute bitsize information for the replacement. We do this in two passes to validate that bitsize information is consistent and correct: first we propagate bitsize from child nodes to parent, then we do it the other way around, starting from the original's instruction destination bitsize. v2 (Iago): - Always use nir_type_bool32 instead of nir_type_bool when generating algebraic optimizations. Before we used nir_type_bool32 with constants and nir_type_bool with variables. - Fix bool comparisons in nir_search.c to account for bitsized types. v3 (Sam): - Unpack the double constant value as unsigned long long (8 bytes) in nir_algrebraic.py. v4 (Sam): - Use helpers to get type size and base type from nir_alu_type. Signed-off-by: Iago Toral Quiroga <itoral@igalia.com> Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com> Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Diffstat (limited to 'src/compiler/nir/nir_search.h')
-rw-r--r--src/compiler/nir/nir_search.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/compiler/nir/nir_search.h b/src/compiler/nir/nir_search.h
index 7d47792..321d6d0 100644
--- a/src/compiler/nir/nir_search.h
+++ b/src/compiler/nir/nir_search.h
@@ -71,10 +71,12 @@ typedef struct {
typedef struct {
nir_search_value value;
+ nir_alu_type type;
+
union {
- uint32_t u;
- int32_t i;
- float f;
+ uint64_t u;
+ int64_t i;
+ double d;
} data;
} nir_search_constant;