Lines Matching defs:op_expr
318 ir_expression *op_expr[4] = {NULL, NULL, NULL, NULL};
341 op_expr[i] = ir->operands[i]->as_expression();
349 if (op_expr[0] && op_expr[0]->operation == ir_unop_bit_not)
350 return op_expr[0]->operands[0];
354 if (op_expr[0] == NULL)
357 switch (op_expr[0]->operation) {
360 return abs(op_expr[0]->operands[0]);
367 if (op_expr[0] == NULL)
370 if (op_expr[0]->operation == ir_unop_neg) {
371 return op_expr[0]->operands[0];
376 if (op_expr[0] == NULL)
379 if (op_expr[0]->operation == ir_unop_log) {
380 return op_expr[0]->operands[0];
385 if (op_expr[0] == NULL)
388 if (op_expr[0]->operation == ir_unop_exp) {
389 return op_expr[0]->operands[0];
394 if (op_expr[0] == NULL)
397 if (op_expr[0]->operation == ir_unop_log2) {
398 return op_expr[0]->operands[0];
401 if (op_expr[0]->operation == ir_binop_mul) {
404 op_expr[0]->operands[log2_pos]->as_expression();
410 op_expr[0]->operands[1 - log2_pos]);
417 if (op_expr[0] == NULL)
420 if (op_expr[0]->operation == ir_unop_exp2) {
421 return op_expr[0]->operands[0];
427 if (op_expr[0] && op_expr[0]->operation == ir_unop_trunc) {
430 op_expr[0]->operands[0]);
437 if (op_expr[0] == NULL)
440 switch (op_expr[0]->operation) {
457 op_expr[0]->operands[0],
458 op_expr[0]->operands[1]);
465 if (op_expr[0] && op_expr[0]->operation == ir_binop_add) {
466 ir_expression *b2f_0 = op_expr[0]->operands[0]->as_expression();
467 ir_expression *b2f_1 = op_expr[0]->operands[1]->as_expression();
512 if (op_expr[i]) {
513 if (op_expr[i]->operation == ir_unop_neg) {
515 if (other && op_expr[i]->operands[0]->equals(other)) {
526 reassociate_constant(ir, 0, op_const[0], op_expr[1]);
528 reassociate_constant(ir, 1, op_const[1], op_expr[0]);
532 ir_expression *expr = try_replace_with_dot(op_expr[0], op_expr[1],
547 ir_expression *mul = op_expr[mul_pos];
614 if (op_expr[0] && op_expr[0]->operation == ir_unop_b2f &&
615 op_expr[1] && op_expr[1]->operation == ir_unop_b2f) {
616 return b2f(logic_and(op_expr[0]->operands[0], op_expr[1]->operands[0]));
623 reassociate_constant(ir, 0, op_const[0], op_expr[1]);
625 reassociate_constant(ir, 1, op_const[1], op_expr[0]);
714 ir_expression *add = op_expr[add_pos];
771 } else if (op_expr[0] && op_expr[0]->operation == ir_unop_logic_not &&
772 op_expr[1] && op_expr[1]->operation == ir_unop_logic_not) {
776 return logic_not(logic_or(op_expr[0]->operands[0],
777 op_expr[1]->operands[0]));
811 } else if (op_expr[0] && op_expr[0]->operation == ir_unop_logic_not &&
812 op_expr[1] && op_expr[1]->operation == ir_unop_logic_not) {
816 return logic_not(logic_and(op_expr[0]->operands[0],
817 op_expr[1]->operands[0]));
870 ir_expression *inner_expr = op_expr[op];
935 if (op_expr[0] && op_expr[0]->operation == ir_unop_rcp)
936 return op_expr[0]->operands[0];
938 if (op_expr[0] && (op_expr[0]->operation == ir_unop_exp2 ||
939 op_expr[0]->operation == ir_unop_exp)) {
940 return new(mem_ctx) ir_expression(op_expr[0]->operation, ir->type,
941 neg(op_expr[0]->operands[0]));
944 if (op_expr[0] && op_expr[0]->operation == ir_unop_rsq)
945 return sqrt(op_expr[0]->operands[0]);
948 if (op_expr[0] && op_expr[0]->operation == ir_unop_sqrt) {
949 return rsq(op_expr[0]->operands[0]);