tree-wide: replace MAYBE_UNUSED with ASSERTED
[mesa.git] / src / compiler / glsl / ir_validate.cpp
index 819e8aa60dd3e5a6e0dc8b1a60f777fb01fd7c9a..9be4e721f1a554c27d9359c44bb67edf1f758baf 100644 (file)
@@ -126,7 +126,7 @@ ir_validate::visit_enter(class ir_dereference_array *ir)
       abort();
    }
 
-   if (!ir->array_index->type->is_integer()) {
+   if (!ir->array_index->type->is_integer_32()) {
       printf("ir_dereference_array @ %p does not have integer index: %s\n",
              (void *) ir, ir->array_index->type->name);
       abort();
@@ -535,14 +535,14 @@ ir_validate::visit_leave(ir_expression *ir)
 
    case ir_unop_bitfield_reverse:
       assert(ir->operands[0]->type == ir->type);
-      assert(ir->type->is_integer());
+      assert(ir->type->is_integer_32());
       break;
 
    case ir_unop_bit_count:
    case ir_unop_find_msb:
    case ir_unop_find_lsb:
       assert(ir->operands[0]->type->vector_elements == ir->type->vector_elements);
-      assert(ir->operands[0]->type->is_integer());
+      assert(ir->operands[0]->type->is_integer_32());
       assert(ir->type->base_type == GLSL_TYPE_INT);
       break;
 
@@ -621,6 +621,17 @@ ir_validate::visit_leave(ir_expression *ir)
       assert(ir->operands[0]->type->base_type ==
              ir->operands[1]->type->base_type);
 
+      if (ir->operation == ir_binop_mul &&
+          (ir->type->base_type == GLSL_TYPE_UINT64 ||
+           ir->type->base_type == GLSL_TYPE_INT64) &&
+          (ir->operands[0]->type->base_type == GLSL_TYPE_INT ||
+           ir->operands[1]->type->base_type == GLSL_TYPE_INT ||
+           ir->operands[0]->type->base_type == GLSL_TYPE_UINT ||
+           ir->operands[1]->type->base_type == GLSL_TYPE_UINT)) {
+         assert(ir->operands[0]->type == ir->operands[1]->type);
+         break;
+      }
+
       if (ir->operands[0]->type->is_scalar())
         assert(ir->operands[1]->type == ir->type);
       else if (ir->operands[1]->type->is_scalar())
@@ -635,7 +646,7 @@ ir_validate::visit_leave(ir_expression *ir)
    case ir_binop_imul_high:
       assert(ir->type == ir->operands[0]->type);
       assert(ir->type == ir->operands[1]->type);
-      assert(ir->type->is_integer());
+      assert(ir->type->is_integer_32());
       break;
 
    case ir_binop_carry:
@@ -674,7 +685,7 @@ ir_validate::visit_leave(ir_expression *ir)
    case ir_binop_lshift:
    case ir_binop_rshift:
       assert(ir->operands[0]->type->is_integer_32_64() &&
-             ir->operands[1]->type->is_integer());
+             ir->operands[1]->type->is_integer_32());
       if (ir->operands[0]->type->is_scalar()) {
           assert(ir->operands[1]->type->is_scalar());
       }
@@ -734,7 +745,7 @@ ir_validate::visit_leave(ir_expression *ir)
    case ir_binop_vector_extract:
       assert(ir->operands[0]->type->is_vector());
       assert(ir->operands[1]->type->is_scalar()
-             && ir->operands[1]->type->is_integer());
+             && ir->operands[1]->type->is_integer_32());
       break;
 
    case ir_binop_interpolate_at_offset:
@@ -775,7 +786,7 @@ ir_validate::visit_leave(ir_expression *ir)
       break;
 
    case ir_triop_bitfield_extract:
-      assert(ir->type->is_integer());
+      assert(ir->type->is_integer_32());
       assert(ir->operands[0]->type == ir->type);
       assert(ir->operands[1]->type == ir->type);
       assert(ir->operands[2]->type == ir->type);
@@ -786,12 +797,12 @@ ir_validate::visit_leave(ir_expression *ir)
       assert(ir->operands[1]->type->is_scalar());
       assert(ir->operands[0]->type->base_type == ir->operands[1]->type->base_type);
       assert(ir->operands[2]->type->is_scalar()
-             && ir->operands[2]->type->is_integer());
+             && ir->operands[2]->type->is_integer_32());
       assert(ir->type == ir->operands[0]->type);
       break;
 
    case ir_quadop_bitfield_insert:
-      assert(ir->type->is_integer());
+      assert(ir->type->is_integer_32());
       assert(ir->operands[0]->type == ir->type);
       assert(ir->operands[1]->type == ir->type);
       assert(ir->operands[2]->type == ir->type);
@@ -1041,7 +1052,7 @@ ir_validate::validate_ir(ir_instruction *ir, void *data)
    _mesa_set_add(ir_set, ir);
 }
 
-MAYBE_UNUSED static void
+ASSERTED static void
 check_node_type(ir_instruction *ir, void *data)
 {
    (void) data;