glsl: Add 64-bit integer support to some operations.

This adds 64-bit integer support to some AST and IR operations where
it is needed.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
This commit is contained in:
Dave Airlie 2016-06-09 10:08:50 +10:00 committed by Ian Romanick
parent 25c7a61b28
commit 9ba9a7f854
2 changed files with 8 additions and 8 deletions

View file

@ -533,12 +533,12 @@ bit_logic_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b,
* (|). The operands must be of type signed or unsigned integers or * (|). The operands must be of type signed or unsigned integers or
* integer vectors." * integer vectors."
*/ */
if (!type_a->is_integer()) { if (!type_a->is_integer_32_64()) {
_mesa_glsl_error(loc, state, "LHS of `%s' must be an integer", _mesa_glsl_error(loc, state, "LHS of `%s' must be an integer",
ast_expression::operator_string(op)); ast_expression::operator_string(op));
return glsl_type::error_type; return glsl_type::error_type;
} }
if (!type_b->is_integer()) { if (!type_b->is_integer_32_64()) {
_mesa_glsl_error(loc, state, "RHS of `%s' must be an integer", _mesa_glsl_error(loc, state, "RHS of `%s' must be an integer",
ast_expression::operator_string(op)); ast_expression::operator_string(op));
return glsl_type::error_type; return glsl_type::error_type;
@ -619,11 +619,11 @@ modulus_result_type(ir_rvalue * &value_a, ir_rvalue * &value_b,
* "The operator modulus (%) operates on signed or unsigned integers or * "The operator modulus (%) operates on signed or unsigned integers or
* integer vectors." * integer vectors."
*/ */
if (!type_a->is_integer()) { if (!type_a->is_integer_32_64()) {
_mesa_glsl_error(loc, state, "LHS of operator %% must be an integer"); _mesa_glsl_error(loc, state, "LHS of operator %% must be an integer");
return glsl_type::error_type; return glsl_type::error_type;
} }
if (!type_b->is_integer()) { if (!type_b->is_integer_32_64()) {
_mesa_glsl_error(loc, state, "RHS of operator %% must be an integer"); _mesa_glsl_error(loc, state, "RHS of operator %% must be an integer");
return glsl_type::error_type; return glsl_type::error_type;
} }
@ -741,7 +741,7 @@ shift_result_type(const struct glsl_type *type_a,
* must be signed or unsigned integers or integer vectors. One operand * must be signed or unsigned integers or integer vectors. One operand
* can be signed while the other is unsigned." * can be signed while the other is unsigned."
*/ */
if (!type_a->is_integer()) { if (!type_a->is_integer_32_64()) {
_mesa_glsl_error(loc, state, "LHS of operator %s must be an integer or " _mesa_glsl_error(loc, state, "LHS of operator %s must be an integer or "
"integer vector", ast_expression::operator_string(op)); "integer vector", ast_expression::operator_string(op));
return glsl_type::error_type; return glsl_type::error_type;
@ -1561,7 +1561,7 @@ ast_expression::do_hir(exec_list *instructions,
error_emitted = true; error_emitted = true;
} }
if (!op[0]->type->is_integer()) { if (!op[0]->type->is_integer_32_64()) {
_mesa_glsl_error(&loc, state, "operand of `~' must be an integer"); _mesa_glsl_error(&loc, state, "operand of `~' must be an integer");
error_emitted = true; error_emitted = true;
} }

View file

@ -653,7 +653,7 @@ ir_validate::visit_leave(ir_expression *ir)
case ir_binop_lshift: case ir_binop_lshift:
case ir_binop_rshift: 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()); ir->operands[1]->type->is_integer());
if (ir->operands[0]->type->is_scalar()) { if (ir->operands[0]->type->is_scalar()) {
assert(ir->operands[1]->type->is_scalar()); assert(ir->operands[1]->type->is_scalar());
@ -671,7 +671,7 @@ ir_validate::visit_leave(ir_expression *ir)
case ir_binop_bit_or: case ir_binop_bit_or:
assert(ir->operands[0]->type->base_type == assert(ir->operands[0]->type->base_type ==
ir->operands[1]->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() && if (ir->operands[0]->type->is_vector() &&
ir->operands[1]->type->is_vector()) { ir->operands[1]->type->is_vector()) {
assert(ir->operands[0]->type->vector_elements == assert(ir->operands[0]->type->vector_elements ==