Lines Matching refs:operands
181 if (ir->operands[0]->type->is_vector()) in update_type()
182 ir->type = ir->operands[0]->type; in update_type()
184 ir->type = ir->operands[1]->type; in update_type()
195 ir_swizzle *x = expr0->operands[0]->as_swizzle(); in try_replace_with_dot()
196 ir_swizzle *y = expr0->operands[1]->as_swizzle(); in try_replace_with_dot()
197 ir_swizzle *z = expr1->operands[0]->as_swizzle(); in try_replace_with_dot()
198 ir_swizzle *w = expr1->operands[1]->as_swizzle(); in try_replace_with_dot()
233 ir_rvalue *temp = ir2->operands[op2]; in reassociate_operands()
234 ir2->operands[op2] = ir1->operands[op1]; in reassociate_operands()
235 ir1->operands[op1] = temp; in reassociate_operands()
260 if (ir1->operands[0]->type->is_matrix() || in reassociate_constant()
261 ir1->operands[1]->type->is_matrix() || in reassociate_constant()
262 ir2->operands[0]->type->is_matrix() || in reassociate_constant()
263 ir2->operands[1]->type->is_matrix()) in reassociate_constant()
269 ir2_const[0] = ir2->operands[0]->constant_expression_value(mem_ctx); in reassociate_constant()
270 ir2_const[1] = ir2->operands[1]->constant_expression_value(mem_ctx); in reassociate_constant()
284 ir2->operands[0]->as_expression())) { in reassociate_constant()
290 ir2->operands[1]->as_expression())) { in reassociate_constant()
320 ir->operands[0]->type->is_matrix() && in handle_expression()
321 ir->operands[1]->type->is_vector()) { in handle_expression()
322 ir_expression *matrix_mul = ir->operands[0]->as_expression(); in handle_expression()
325 matrix_mul->operands[0]->type->is_matrix() && in handle_expression()
326 matrix_mul->operands[1]->type->is_matrix()) { in handle_expression()
328 return mul(matrix_mul->operands[0], in handle_expression()
329 mul(matrix_mul->operands[1], ir->operands[1])); in handle_expression()
335 if (ir->operands[i]->type->is_matrix()) in handle_expression()
339 ir->operands[i]->constant_expression_value(ralloc_parent(ir)); in handle_expression()
340 op_expr[i] = ir->operands[i]->as_expression(); in handle_expression()
349 return op_expr[0]->operands[0]; in handle_expression()
359 return abs(op_expr[0]->operands[0]); in handle_expression()
370 return op_expr[0]->operands[0]; in handle_expression()
379 return op_expr[0]->operands[0]; in handle_expression()
388 return op_expr[0]->operands[0]; in handle_expression()
397 return op_expr[0]->operands[0]; in handle_expression()
403 op_expr[0]->operands[log2_pos]->as_expression(); in handle_expression()
408 log2_expr->operands[0], in handle_expression()
409 op_expr[0]->operands[1 - log2_pos]); in handle_expression()
420 return op_expr[0]->operands[0]; in handle_expression()
429 op_expr[0]->operands[0]); in handle_expression()
456 op_expr[0]->operands[0], in handle_expression()
457 op_expr[0]->operands[1]); in handle_expression()
465 ir_expression *b2f_0 = op_expr[0]->operands[0]->as_expression(); in handle_expression()
466 ir_expression *b2f_1 = op_expr[0]->operands[1]->as_expression(); in handle_expression()
470 return b2f(logic_or(b2f_0->operands[0], b2f_1->operands[0])); in handle_expression()
480 ir_expression *const op = ir->operands[0]->as_expression(); \ in handle_expression()
484 return op->operands[0]; \ in handle_expression()
505 return ir->operands[1]; in handle_expression()
507 return ir->operands[0]; in handle_expression()
544 mul->operands[inner_add_pos]->as_expression(); in handle_expression()
555 inner_add->operands[neg_pos]->as_expression(); in handle_expression()
560 ir_rvalue *x_operand = ir->operands[1 - mul_pos]; in handle_expression()
562 if (!neg->operands[0]->equals(x_operand)) in handle_expression()
565 ir_rvalue *y_operand = inner_add->operands[1 - neg_pos]; in handle_expression()
566 ir_rvalue *a_operand = mul->operands[1 - inner_add_pos]; in handle_expression()
581 return neg(ir->operands[1]); in handle_expression()
583 return ir->operands[0]; in handle_expression()
588 return ir->operands[1]; in handle_expression()
590 return ir->operands[0]; in handle_expression()
596 return neg(ir->operands[1]); in handle_expression()
598 return neg(ir->operands[0]); in handle_expression()
602 return b2f(logic_and(op_expr[0]->operands[0], op_expr[1]->operands[0])); in handle_expression()
622 ir_expression *sign_expr = ir->operands[i]->as_expression(); in handle_expression()
623 ir_expression *floor_expr = ir->operands[1 - i]->as_expression(); in handle_expression()
629 ir_expression *add_expr = floor_expr->operands[0]->as_expression(); in handle_expression()
634 ir_expression *abs_expr = add_expr->operands[j]->as_expression(); in handle_expression()
638 ir_constant *point_five = add_expr->operands[1 - j]->as_constant(); in handle_expression()
642 if (abs_expr->operands[0]->equals(sign_expr->operands[0])) { in handle_expression()
643 return trunc(add(abs_expr->operands[0], in handle_expression()
654 ir->operands[1]->type, in handle_expression()
655 ir->operands[1], in handle_expression()
659 return ir->operands[0]; in handle_expression()
690 new(mem_ctx) ir_swizzle(ir->operands[0], in handle_expression()
692 new(mem_ctx) ir_swizzle(ir->operands[1], in handle_expression()
716 neg(add->operands[0]), in handle_expression()
717 add->operands[1]); in handle_expression()
720 add->operands[0], in handle_expression()
721 neg(add->operands[1])); in handle_expression()
728 if (ir->operands[0]->type->is_scalar() && in handle_expression()
729 ir->operands[1]->type->is_scalar()) in handle_expression()
732 ir->operands[0], in handle_expression()
733 ir->operands[1]); in handle_expression()
740 return ir->operands[0]; in handle_expression()
743 return ir->operands[0]; in handle_expression()
748 return ir->operands[1]; in handle_expression()
750 return ir->operands[0]; in handle_expression()
758 return logic_not(logic_or(op_expr[0]->operands[0], in handle_expression()
759 op_expr[1]->operands[0])); in handle_expression()
760 } else if (ir->operands[0]->equals(ir->operands[1])) { in handle_expression()
762 return ir->operands[0]; in handle_expression()
768 return ir->operands[1]; in handle_expression()
770 return ir->operands[0]; in handle_expression()
772 return logic_not(ir->operands[1]); in handle_expression()
774 return logic_not(ir->operands[0]); in handle_expression()
775 } else if (ir->operands[0]->equals(ir->operands[1])) { in handle_expression()
783 return ir->operands[1]; in handle_expression()
785 return ir->operands[0]; in handle_expression()
798 return logic_not(logic_and(op_expr[0]->operands[0], in handle_expression()
799 op_expr[1]->operands[0])); in handle_expression()
800 } else if (ir->operands[0]->equals(ir->operands[1])) { in handle_expression()
802 return ir->operands[0]; in handle_expression()
813 return ir->operands[0]; in handle_expression()
817 return expr(ir_unop_exp2, ir->operands[1]); in handle_expression()
820 ir_variable *x = new(ir) ir_variable(ir->operands[1]->type, "x", in handle_expression()
823 base_ir->insert_before(assign(x, ir->operands[0])); in handle_expression()
828 ir_variable *x = new(ir) ir_variable(ir->operands[1]->type, "x", in handle_expression()
831 base_ir->insert_before(assign(x, ir->operands[0])); in handle_expression()
833 ir_variable *squared = new(ir) ir_variable(ir->operands[1]->type, in handle_expression()
861 if (!inner_expr->operands[0]->as_constant() && in handle_expression()
862 !inner_expr->operands[1]->as_constant()) in handle_expression()
869 ir_rvalue *x = inner_expr->operands[minmax_op]; in handle_expression()
870 ir_rvalue *y = inner_expr->operands[1 - minmax_op]; in handle_expression()
918 return op_expr[0]->operands[0]; in handle_expression()
923 neg(op_expr[0]->operands[0])); in handle_expression()
930 return sqrt(op_expr[0]->operands[0]); in handle_expression()
934 return rsq(op_expr[0]->operands[0]); in handle_expression()
942 return ir->operands[2]; in handle_expression()
944 return mul(ir->operands[0], ir->operands[1]); in handle_expression()
946 return add(ir->operands[1], ir->operands[2]); in handle_expression()
948 return add(ir->operands[0], ir->operands[2]); in handle_expression()
955 return ir->operands[0]; in handle_expression()
957 return ir->operands[1]; in handle_expression()
958 } else if (ir->operands[0]->equals(ir->operands[1])) { in handle_expression()
959 return ir->operands[0]; in handle_expression()
961 return mul(ir->operands[1], ir->operands[2]); in handle_expression()
963 unsigned op2_components = ir->operands[2]->type->vector_elements; in handle_expression()
978 return mul(ir->operands[0], add(one, neg(ir->operands[2]))); in handle_expression()
984 return ir->operands[1]; in handle_expression()
986 return ir->operands[2]; in handle_expression()
996 return ir->operands[0]; in handle_expression()