diff options
author | Iago Toral Quiroga <itoral@igalia.com> | 2016-03-16 12:11:34 +0100 |
---|---|---|
committer | Samuel Iglesias Gonsálvez <siglesias@igalia.com> | 2016-03-17 11:16:33 +0100 |
commit | 084b24f5582567ebf5aa94b7f40ae3bdcb71316b (patch) | |
tree | ab6e03937f655aafbec7d658dd89cd7709292f33 /src/compiler/nir/nir_constant_expressions.py | |
parent | 9076c4e289de0debf1fb2a7237bdeb9c11002347 (diff) | |
download | external_mesa3d-084b24f5582567ebf5aa94b7f40ae3bdcb71316b.zip external_mesa3d-084b24f5582567ebf5aa94b7f40ae3bdcb71316b.tar.gz external_mesa3d-084b24f5582567ebf5aa94b7f40ae3bdcb71316b.tar.bz2 |
nir: rename nir_const_value fields to include bitsize information
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Diffstat (limited to 'src/compiler/nir/nir_constant_expressions.py')
-rw-r--r-- | src/compiler/nir/nir_constant_expressions.py | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/compiler/nir/nir_constant_expressions.py b/src/compiler/nir/nir_constant_expressions.py index 972d281..e36dc48 100644 --- a/src/compiler/nir/nir_constant_expressions.py +++ b/src/compiler/nir/nir_constant_expressions.py @@ -22,19 +22,19 @@ def type_add_size(type_, size): def get_const_field(type_): if type_ == "int32": - return "i" + return "i32" if type_ == "uint32": - return "u" + return "u32" if type_ == "int64": - return "l" + return "i64" if type_ == "uint64": - return "ul" + return "u64" if type_ == "bool32": - return "b" + return "u32" if type_ == "float32": - return "f" + return "f32" if type_ == "float64": - return "d" + return "f64" raise Exception(str(type_)) assert(0) @@ -294,7 +294,7 @@ evaluate_${name}(unsigned num_components, unsigned bit_size, struct ${input_types[j]}_vec src${j} = { % for k in range(op.input_sizes[j]): % if input_types[j] == "bool32": - _src[${j}].u[${k}] != 0, + _src[${j}].u32[${k}] != 0, % else: _src[${j}].${get_const_field(input_types[j])}[${k}], % endif @@ -316,7 +316,7 @@ evaluate_${name}(unsigned num_components, unsigned bit_size, ## Avoid unused variable warnings <% continue %> % elif input_types[j] == "bool32": - bool src${j} = _src[${j}].u[_i] != 0; + bool src${j} = _src[${j}].u32[_i] != 0; % else: ${input_types[j]}_t src${j} = _src[${j}].${get_const_field(input_types[j])}[_i]; @@ -337,7 +337,7 @@ evaluate_${name}(unsigned num_components, unsigned bit_size, ## value of dst. % if output_type == "bool32": ## Sanitize the C value to a proper NIR bool - _dst_val.u[_i] = dst ? NIR_TRUE : NIR_FALSE; + _dst_val.u32[_i] = dst ? NIR_TRUE : NIR_FALSE; % else: _dst_val.${get_const_field(output_type)}[_i] = dst; % endif @@ -364,7 +364,7 @@ evaluate_${name}(unsigned num_components, unsigned bit_size, % for k in range(op.output_size): % if output_type == "bool32": ## Sanitize the C value to a proper NIR bool - _dst_val.u[${k}] = dst.${"xyzw"[k]} ? NIR_TRUE : NIR_FALSE; + _dst_val.u32[${k}] = dst.${"xyzw"[k]} ? NIR_TRUE : NIR_FALSE; % else: _dst_val.${get_const_field(output_type)}[${k}] = dst.${"xyzw"[k]}; % endif |