assert(ir->type->base_type == GLSL_TYPE_INT);
break;
+ case ir_unop_clz:
+ assert(ir->operands[0]->type == ir->type);
+ assert(ir->type->base_type == GLSL_TYPE_UINT);
+ break;
+
case ir_unop_noise:
/* XXX what can we assert here? */
break;
assert(ir->operands[0]->type->is_float());
assert(ir->type->is_double());
break;
+ case ir_unop_f162f:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT16);
+ assert(ir->type->is_float());
+ break;
+ case ir_unop_f2f16:
+ assert(ir->operands[0]->type->is_float());
+ assert(ir->type->base_type == GLSL_TYPE_FLOAT16);
+ break;
case ir_unop_d2i:
assert(ir->operands[0]->type->is_double());
assert(ir->type->base_type == GLSL_TYPE_INT);
assert(ir->type->base_type == GLSL_TYPE_INT);
break;
+ case ir_unop_atan:
+ assert(ir->operands[0]->type->is_float() ||
+ ir->operands[0]->type->is_double());
+ assert(ir->type == ir->operands[0]->type);
+ break;
+
case ir_binop_add:
case ir_binop_sub:
case ir_binop_mul:
}
break;
+ case ir_binop_abs_sub:
+ assert(ir->operands[0]->type == ir->operands[1]->type);
+ assert(ir->operands[0]->type->is_integer_32_64());
+ assert(ir->operands[0]->type->vector_elements ==
+ ir->type->vector_elements);
+ assert(ir->type->base_type == GLSL_TYPE_UINT ||
+ ir->type->base_type == GLSL_TYPE_UINT64);
+ break;
+
+ case ir_binop_add_sat:
+ case ir_binop_sub_sat:
+ case ir_binop_avg:
+ case ir_binop_avg_round:
+ assert(ir->type == ir->operands[0]->type);
+ assert(ir->type == ir->operands[1]->type);
+ assert(ir->type->is_integer_32_64());
+ break;
+
+ case ir_binop_mul_32x16:
case ir_binop_imul_high:
assert(ir->type == ir->operands[0]->type);
assert(ir->type == ir->operands[1]->type);
assert(ir->operands[1]->type == glsl_type::int_type);
break;
+ case ir_binop_atan2:
+ assert(ir->operands[0]->type->is_float() ||
+ ir->operands[0]->type->is_double());
+ assert(ir->operands[1]->type == ir->operands[0]->type);
+ assert(ir->type == ir->operands[0]->type);
+ break;
+
case ir_triop_fma:
assert(ir->type->is_float() ||
ir->type->is_double());
_mesa_set_add(ir_set, ir);
}
-MAYBE_UNUSED static void
+#ifdef DEBUG
+static void
check_node_type(ir_instruction *ir, void *data)
{
(void) data;
if (value != NULL)
assert(value->type != glsl_type::error_type);
}
+#endif
void
validate_ir_tree(exec_list *instructions)