Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
case ir_unop_abs:
for (unsigned c = 0; c < op[0]->type->components(); c++) {
switch (this->type->base_type) {
- case GLSL_TYPE_UINT:
- data.u[c] = op[0]->value.u[c];
- break;
case GLSL_TYPE_INT:
data.i[c] = op[0]->value.i[c];
if (data.i[c] < 0)
case ir_unop_sign:
for (unsigned c = 0; c < op[0]->type->components(); c++) {
switch (this->type->base_type) {
- case GLSL_TYPE_UINT:
- data.u[c] = op[0]->value.i[c] > 0;
- break;
case GLSL_TYPE_INT:
data.i[c] = (op[0]->value.i[c] > 0) - (op[0]->value.i[c] < 0);
break;
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);
+ assert(ir->type == ir->operands[0]->type);
+ break;
+
case ir_unop_rcp:
case ir_unop_rsq:
case ir_unop_sqrt: