Home | History | Annotate | Download | only in glsl

Lines Matching refs:ir

35 #include "ir.h"
60 ir_div_to_mul_rcp_visitor::visit_leave(ir_expression *ir)
62 if (ir->operation != ir_binop_div)
65 if (ir->operands[1]->type->base_type != GLSL_TYPE_INT &&
66 ir->operands[1]->type->base_type != GLSL_TYPE_UINT) {
69 expr = new(ir) ir_expression(ir_unop_rcp,
70 ir->operands[1]->type,
71 ir->operands[1],
75 ir->operation = ir_binop_mul;
76 ir->operands[1] = expr;
86 ir->operands[1]->type->vector_elements,
87 ir->operands[1]->type->matrix_columns);
89 if (ir->operands[1]->type->base_type == GLSL_TYPE_INT)
90 op1 = new(ir) ir_expression(ir_unop_i2f, vec_type, ir->operands[1], NULL);
92 op1 = new(ir) ir_expression(ir_unop_u2f, vec_type, ir->operands[1], NULL);
94 op1 = new(ir) ir_expression(ir_unop_rcp, op1->type, op1, NULL);
97 ir->operands[0]->type->vector_elements,
98 ir->operands[0]->type->matrix_columns);
100 if (ir->operands[0]->type->base_type == GLSL_TYPE_INT)
101 op0 = new(ir) ir_expression(ir_unop_i2f, vec_type, ir->operands[0], NULL);
103 op0 = new(ir) ir_expression(ir_unop_u2f, vec_type, ir->operands[0], NULL);
105 op0 = new(ir) ir_expression(ir_binop_mul, vec_type, op0, op1);
107 ir->operation = ir_unop_f2i;
108 ir->operands[0] = op0;
109 ir->operands[1] = NULL;