nir/algebraic: Use bool internally instead of bool32
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 19 Oct 2018 03:31:08 +0000 (22:31 -0500)
committerJason Ekstrand <jason.ekstrand@intel.com>
Mon, 22 Oct 2018 21:00:18 +0000 (16:00 -0500)
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
src/compiler/nir/nir_algebraic.py
src/compiler/nir/nir_search.c

index 3055937029cf8fa14dfc014919c2a946109b8a59..eccef0d2c97e09cd7e32bfb663fb67e3fdf2ee01 100644 (file)
@@ -165,7 +165,7 @@ class Constant(Value):
 
    def type(self):
       if isinstance(self.value, (bool)):
-         return "nir_type_bool32"
+         return "nir_type_bool"
       elif isinstance(self.value, integer_types):
          return "nir_type_int"
       elif isinstance(self.value, float):
@@ -199,7 +199,7 @@ class Variable(Value):
 
    def type(self):
       if self.required_type == 'bool':
-         return "nir_type_bool32"
+         return "nir_type_bool"
       elif self.required_type in ('int', 'uint'):
          return "nir_type_int"
       elif self.required_type == 'float':
index 9c5cb547a701b02c944aefca9ae0facb5408bc62..1686b6bd0de875bc5003aa6dc2609311ad9e929d 100644 (file)
@@ -56,10 +56,6 @@ src_is_type(nir_src src, nir_alu_type type)
    if (!src.is_ssa)
       return false;
 
-   /* Turn nir_type_bool32 into nir_type_bool...they're the same thing. */
-   if (nir_alu_type_get_base_type(type) == nir_type_bool)
-      type = nir_type_bool;
-
    if (src.ssa->parent_instr->type == nir_instr_type_alu) {
       nir_alu_instr *src_alu = nir_instr_as_alu(src.ssa->parent_instr);
       nir_alu_type output_type = nir_op_infos[src_alu->op].output_type;
@@ -196,7 +192,7 @@ match_value(const nir_search_value *value, nir_alu_instr *instr, unsigned src,
 
       case nir_type_int:
       case nir_type_uint:
-      case nir_type_bool32: {
+      case nir_type_bool: {
          unsigned bit_size = nir_src_bit_size(instr->src[src].src);
          uint64_t mask = bit_size == 64 ? UINT64_MAX : (1ull << bit_size) - 1;
          for (unsigned i = 0; i < num_components; ++i) {
@@ -535,7 +531,8 @@ construct_value(const nir_search_value *value,
          }
          break;
 
-      case nir_type_bool32:
+      case nir_type_bool:
+         assert(bitsize->dest_size == 32);
          load->value.u32[0] = c->data.u;
          break;
       default: