break;
case ir_unop_neg:
+ assert(ir->type == ir->operands[0]->type);
+ break;
+
case ir_unop_abs:
case ir_unop_sign:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT ||
+ ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT ||
+ ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE ||
+ ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
+ assert(ir->type == ir->operands[0]->type);
+ break;
+
case ir_unop_rcp:
case ir_unop_rsq:
case ir_unop_sqrt:
+ assert(ir->type->base_type == GLSL_TYPE_FLOAT ||
+ ir->type->base_type == GLSL_TYPE_DOUBLE);
assert(ir->type == ir->operands[0]->type);
break;
assert(ir->type->base_type == GLSL_TYPE_UINT);
break;
+ case ir_unop_bitcast_u642d:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64);
+ assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
+ break;
+ case ir_unop_bitcast_i642d:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
+ assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
+ break;
+ case ir_unop_bitcast_d2u64:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
+ assert(ir->type->base_type == GLSL_TYPE_UINT64);
+ break;
+ case ir_unop_bitcast_d2i64:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
+ assert(ir->type->base_type == GLSL_TYPE_INT64);
+ break;
+ case ir_unop_i642i:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
+ assert(ir->type->base_type == GLSL_TYPE_INT);
+ break;
+ case ir_unop_u642i:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64);
+ assert(ir->type->base_type == GLSL_TYPE_INT);
+ break;
+ case ir_unop_i642u:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
+ assert(ir->type->base_type == GLSL_TYPE_UINT);
+ break;
+ case ir_unop_u642u:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64);
+ assert(ir->type->base_type == GLSL_TYPE_UINT);
+ break;
+ case ir_unop_i642b:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
+ assert(ir->type->base_type == GLSL_TYPE_BOOL);
+ break;
+ case ir_unop_i642f:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
+ assert(ir->type->base_type == GLSL_TYPE_FLOAT);
+ break;
+ case ir_unop_u642f:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64);
+ assert(ir->type->base_type == GLSL_TYPE_FLOAT);
+ break;
+ case ir_unop_i642d:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
+ assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
+ break;
+ case ir_unop_u642d:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64);
+ assert(ir->type->base_type == GLSL_TYPE_DOUBLE);
+ break;
+ case ir_unop_i2i64:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT);
+ assert(ir->type->base_type == GLSL_TYPE_INT64);
+ break;
+ case ir_unop_u2i64:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT);
+ assert(ir->type->base_type == GLSL_TYPE_INT64);
+ break;
+ case ir_unop_b2i64:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_BOOL);
+ assert(ir->type->base_type == GLSL_TYPE_INT64);
+ break;
+ case ir_unop_f2i64:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
+ assert(ir->type->base_type == GLSL_TYPE_INT64);
+ break;
+ case ir_unop_d2i64:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
+ assert(ir->type->base_type == GLSL_TYPE_INT64);
+ break;
+ case ir_unop_i2u64:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT);
+ assert(ir->type->base_type == GLSL_TYPE_UINT64);
+ break;
+ case ir_unop_u2u64:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT);
+ assert(ir->type->base_type == GLSL_TYPE_UINT64);
+ break;
+ case ir_unop_f2u64:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_FLOAT);
+ assert(ir->type->base_type == GLSL_TYPE_UINT64);
+ break;
+ case ir_unop_d2u64:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_DOUBLE);
+ assert(ir->type->base_type == GLSL_TYPE_UINT64);
+ break;
+ case ir_unop_u642i64:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_UINT64);
+ assert(ir->type->base_type == GLSL_TYPE_INT64);
+ break;
+ case ir_unop_i642u64:
+ assert(ir->operands[0]->type->base_type == GLSL_TYPE_INT64);
+ assert(ir->type->base_type == GLSL_TYPE_UINT64);
+ break;
case ir_unop_trunc:
case ir_unop_round_even:
case ir_unop_ceil:
assert(ir->operands[0]->type == glsl_type::uvec2_type);
break;
+ case ir_unop_pack_int_2x32:
+ assert(ir->type == glsl_type::int64_t_type);
+ assert(ir->operands[0]->type == glsl_type::ivec2_type);
+ break;
+
+ case ir_unop_pack_uint_2x32:
+ assert(ir->type == glsl_type::uint64_t_type);
+ assert(ir->operands[0]->type == glsl_type::uvec2_type);
+ break;
+
case ir_unop_unpack_snorm_2x16:
case ir_unop_unpack_unorm_2x16:
case ir_unop_unpack_half_2x16:
assert(ir->operands[0]->type == glsl_type::uint_type);
break;
- case ir_unop_unpack_half_2x16_split_x:
- case ir_unop_unpack_half_2x16_split_y:
- assert(ir->type == glsl_type::float_type);
- assert(ir->operands[0]->type == glsl_type::uint_type);
- break;
-
case ir_unop_unpack_double_2x32:
assert(ir->type == glsl_type::uvec2_type);
assert(ir->operands[0]->type == glsl_type::double_type);
break;
+ case ir_unop_unpack_int_2x32:
+ assert(ir->type == glsl_type::ivec2_type);
+ assert(ir->operands[0]->type == glsl_type::int64_t_type);
+ break;
+
+ case ir_unop_unpack_uint_2x32:
+ assert(ir->type == glsl_type::uvec2_type);
+ assert(ir->operands[0]->type == glsl_type::uint64_t_type);
+ break;
+
case ir_unop_bitfield_reverse:
assert(ir->operands[0]->type == ir->type);
assert(ir->type->is_integer());
assert(ir->operands[0]->type->base_type == GLSL_TYPE_SUBROUTINE);
assert(ir->type->base_type == GLSL_TYPE_INT);
break;
+
+ case ir_unop_ballot:
+ assert(ir->type == glsl_type::uint64_t_type);
+ assert(ir->operands[0]->type == glsl_type::bool_type);
+ break;
+
+ case ir_binop_read_invocation:
+ assert(ir->operands[1]->type == glsl_type::uint_type);
+ /* fall-through */
+ case ir_unop_read_first_invocation:
+ assert(ir->type == ir->operands[0]->type);
+ assert(ir->type->is_scalar() || ir->type->is_vector());
+ assert(ir->type->base_type == GLSL_TYPE_FLOAT ||
+ ir->type->base_type == GLSL_TYPE_INT ||
+ ir->type->base_type == GLSL_TYPE_UINT);
+ break;
+
+ case ir_unop_vote_any:
+ case ir_unop_vote_all:
+ case ir_unop_vote_eq:
+ assert(ir->type == glsl_type::bool_type);
+ assert(ir->operands[0]->type == glsl_type::bool_type);
+ break;
+
case ir_binop_add:
case ir_binop_sub:
case ir_binop_mul:
case ir_binop_lshift:
case ir_binop_rshift:
- assert(ir->operands[0]->type->is_integer() &&
+ assert(ir->operands[0]->type->is_integer_32_64() &&
ir->operands[1]->type->is_integer());
if (ir->operands[0]->type->is_scalar()) {
assert(ir->operands[1]->type->is_scalar());
case ir_binop_bit_or:
assert(ir->operands[0]->type->base_type ==
ir->operands[1]->type->base_type);
- assert(ir->type->is_integer());
+ assert(ir->type->is_integer_32_64());
if (ir->operands[0]->type->is_vector() &&
ir->operands[1]->type->is_vector()) {
assert(ir->operands[0]->type->vector_elements ==
assert(ir->operands[0]->type == ir->operands[1]->type);
break;
- case ir_binop_pack_half_2x16_split:
- assert(ir->type == glsl_type::uint_type);
- assert(ir->operands[0]->type == glsl_type::float_type);
- assert(ir->operands[1]->type == glsl_type::float_type);
- break;
-
case ir_binop_ubo_load:
assert(ir->operands[0]->type == glsl_type::uint_type);
* to be out of bounds.
*/
if (ir->type->array_size() > 0) {
- if (ir->data.max_array_access >= ir->type->length) {
+ if (ir->data.max_array_access >= (int)ir->type->length) {
printf("ir_variable has maximum access out of bounds (%d vs %d)\n",
ir->data.max_array_access, ir->type->length - 1);
ir->print();
const glsl_struct_field *fields =
ir->get_interface_type()->fields.structure;
for (unsigned i = 0; i < ir->get_interface_type()->length; i++) {
- if (fields[i].type->array_size() > 0) {
- const unsigned *const max_ifc_array_access =
+ if (fields[i].type->array_size() > 0 &&
+ !fields[i].implicit_sized_array) {
+ const int *const max_ifc_array_access =
ir->get_max_ifc_array_access();
assert(max_ifc_array_access != NULL);
- if (max_ifc_array_access[i] >= fields[i].type->length) {
+ if (max_ifc_array_access[i] >= (int)fields[i].type->length) {
printf("ir_variable has maximum access out of bounds for "
"field %s (%d vs %d)\n", fields[i].name,
max_ifc_array_access[i], fields[i].type->length);
abort();
}
- const exec_node *formal_param_node = callee->parameters.head;
- const exec_node *actual_param_node = ir->actual_parameters.head;
+ const exec_node *formal_param_node = callee->parameters.get_head_raw();
+ const exec_node *actual_param_node = ir->actual_parameters.get_head_raw();
while (true) {
if (formal_param_node->is_tail_sentinel()
!= actual_param_node->is_tail_sentinel()) {