Lines Matching refs:operands

182    if (ir->operands[0]->type->is_vector())
183 ir->type = ir->operands[0]->type;
185 ir->type = ir->operands[1]->type;
196 ir_swizzle *x = expr0->operands[0]->as_swizzle();
197 ir_swizzle *y = expr0->operands[1]->as_swizzle();
198 ir_swizzle *z = expr1->operands[0]->as_swizzle();
199 ir_swizzle *w = expr1->operands[1]->as_swizzle();
234 ir_rvalue *temp = ir2->operands[op2];
235 ir2->operands[op2] = ir1->operands[op1];
236 ir1->operands[op1] = temp;
239 * base types matched, and at least one of the operands of the 2
261 if (ir1->operands[0]->type->is_matrix() ||
262 ir1->operands[1]->type->is_matrix() ||
263 ir2->operands[0]->type->is_matrix() ||
264 ir2->operands[1]->type->is_matrix())
270 ir2_const[0] = ir2->operands[0]->constant_expression_value(mem_ctx);
271 ir2_const[1] = ir2->operands[1]->constant_expression_value(mem_ctx);
285 ir2->operands[0]->as_expression())) {
291 ir2->operands[1]->as_expression())) {
299 /* When eliminating an expression and just returning one of its operands,
321 ir->operands[0]->type->is_matrix() &&
322 ir->operands[1]->type->is_vector()) {
323 ir_expression *matrix_mul = ir->operands[0]->as_expression();
326 matrix_mul->operands[0]->type->is_matrix() &&
327 matrix_mul->operands[1]->type->is_matrix()) {
329 return mul(matrix_mul->operands[0],
330 mul(matrix_mul->operands[1], ir->operands[1]));
336 if (ir->operands[i]->type->is_matrix())
340 ir->operands[i]->constant_expression_value(ralloc_parent(ir));
341 op_expr[i] = ir->operands[i]->as_expression();
350 return op_expr[0]->operands[0];
360 return abs(op_expr[0]->operands[0]);
371 return op_expr[0]->operands[0];
380 return op_expr[0]->operands[0];
389 return op_expr[0]->operands[0];
398 return op_expr[0]->operands[0];
404 op_expr[0]->operands[log2_pos]->as_expression();
409 log2_expr->operands[0],
410 op_expr[0]->operands[1 - log2_pos]);
421 return op_expr[0]->operands[0];
430 op_expr[0]->operands[0]);
457 op_expr[0]->operands[0],
458 op_expr[0]->operands[1]);
466 ir_expression *b2f_0 = op_expr[0]->operands[0]->as_expression();
467 ir_expression *b2f_1 = op_expr[0]->operands[1]->as_expression();
471 return b2f(logic_or(b2f_0->operands[0], b2f_1->operands[0]));
481 ir_expression *const op = ir->operands[0]->as_expression(); \
485 return op->operands[0]; \
506 return ir->operands[1];
508 return ir->operands[0];
514 ir_rvalue *other = ir->operands[(i + 1) % 2];
515 if (other && op_expr[i]->operands[0]->equals(other)) {
552 /* Multiply found on one of the operands. Now check for an
557 mul->operands[inner_add_pos]->as_expression();
562 /* Inner addition found on one of the operands. Now check for
563 * one of the operands of the inner addition to be the negative
568 inner_add->operands[neg_pos]->as_expression();
573 ir_rvalue *x_operand = ir->operands[1 - mul_pos];
575 if (!neg->operands[0]->equals(x_operand))
578 ir_rvalue *y_operand = inner_add->operands[1 - neg_pos];
579 ir_rvalue *a_operand = mul->operands[1 - inner_add_pos];
595 return neg(ir->operands[1]);
597 return ir->operands[0];
602 return ir->operands[1];
604 return ir->operands[0];
610 return neg(ir->operands[1]);
612 return neg(ir->operands[0]);
616 return b2f(logic_and(op_expr[0]->operands[0], op_expr[1]->operands[0]));
636 ir_expression *sign_expr = ir->operands[i]->as_expression();
637 ir_expression *floor_expr = ir->operands[1 - i]->as_expression();
643 ir_expression *add_expr = floor_expr->operands[0]->as_expression();
648 ir_expression *abs_expr = add_expr->operands[j]->as_expression();
652 ir_constant *point_five = add_expr->operands[1 - j]->as_constant();
656 if (abs_expr->operands[0]->equals(sign_expr->operands[0])) {
657 return trunc(add(abs_expr->operands[0],
668 ir->operands[1]->type,
669 ir->operands[1],
673 return ir->operands[0];
701 /* Swizzle both operands to remove the channels that were zero. */
704 new(mem_ctx) ir_swizzle(ir->operands[0],
706 new(mem_ctx) ir_swizzle(ir->operands[1],
726 if (add->operands[0]->type != add->operands[1]->type)
734 neg(add->operands[0]),
735 add->operands[1]);
738 add->operands[0],
739 neg(add->operands[1]));
746 if (ir->operands[0]->type->is_scalar() &&
747 ir->operands[1]->type->is_scalar())
750 ir->operands[0],
751 ir->operands[1]);
758 return ir->operands[0];
761 return ir->operands[0];
766 return ir->operands[1];
768 return ir->operands[0];
776 return logic_not(logic_or(op_expr[0]->operands[0],
777 op_expr[1]->operands[0]));
778 } else if (ir->operands[0]->equals(ir->operands[1])) {
780 return ir->operands[0];
786 return ir->operands[1];
788 return ir->operands[0];
790 return logic_not(ir->operands[1]);
792 return logic_not(ir->operands[0]);
793 } else if (ir->operands[0]->equals(ir->operands[1])) {
801 return ir->operands[1];
803 return ir->operands[0];
816 return logic_not(logic_and(op_expr[0]->operands[0],
817 op_expr[1]->operands[0]));
818 } else if (ir->operands[0]->equals(ir->operands[1])) {
820 return ir->operands[0];
831 return ir->operands[0];
835 return expr(ir_unop_exp2, ir->operands[1]);
838 ir_variable *x = new(ir) ir_variable(ir->operands[1]->type, "x",
841 base_ir->insert_before(assign(x, ir->operands[0]));
846 ir_variable *x = new(ir) ir_variable(ir->operands[1]->type, "x",
849 base_ir->insert_before(assign(x, ir->operands[0]));
851 ir_variable *squared = new(ir) ir_variable(ir->operands[1]->type,
879 if (!inner_expr->operands[0]->as_constant() &&
880 !inner_expr->operands[1]->as_constant())
883 /* Found a min(max) combination. Now try to see if its operands
887 ir_rvalue *x = inner_expr->operands[minmax_op];
888 ir_rvalue *y = inner_expr->operands[1 - minmax_op];
936 return op_expr[0]->operands[0];
941 neg(op_expr[0]->operands[0]));
945 return sqrt(op_expr[0]->operands[0]);
949 return rsq(op_expr[0]->operands[0]);
957 return ir->operands[2];
959 return mul(ir->operands[0], ir->operands[1]);
961 return add(ir->operands[1], ir->operands[2]);
963 return add(ir->operands[0], ir->operands[2]);
970 return ir->operands[0];
972 return ir->operands[1];
973 } else if (ir->operands[0]->equals(ir->operands[1])) {
974 return ir->operands[0];
976 return mul(ir->operands[1], ir->operands[2]);
978 unsigned op2_components = ir->operands[2]->type->vector_elements;
996 return mul(ir->operands[0], add(one, neg(ir->operands[2])));
1002 return ir->operands[1];
1004 return ir->operands[2];
1014 return ir->operands[0];