diff --git a/src/compiler/glsl/opt_algebraic.cpp b/src/compiler/glsl/opt_algebraic.cpp index 7b7e05995c8..6ca988331fa 100644 --- a/src/compiler/glsl/opt_algebraic.cpp +++ b/src/compiler/glsl/opt_algebraic.cpp @@ -494,52 +494,6 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) break; - case ir_triop_fma: - /* Operands are op0 * op1 + op2. */ - if (is_vec_zero(op_const[0]) || is_vec_zero(op_const[1])) { - return ir->operands[2]; - } else if (is_vec_zero(op_const[2])) { - return mul(ir->operands[0], ir->operands[1]); - } else if (is_vec_one(op_const[0])) { - return add(ir->operands[1], ir->operands[2]); - } else if (is_vec_one(op_const[1])) { - return add(ir->operands[0], ir->operands[2]); - } - break; - - case ir_triop_lrp: - /* Operands are (x, y, a). */ - if (is_vec_zero(op_const[2])) { - return ir->operands[0]; - } else if (is_vec_one(op_const[2])) { - return ir->operands[1]; - } else if (ir->operands[0]->equals(ir->operands[1])) { - return ir->operands[0]; - } else if (is_vec_zero(op_const[0])) { - return mul(ir->operands[1], ir->operands[2]); - } else if (is_vec_zero(op_const[1])) { - unsigned op2_components = ir->operands[2]->type->vector_elements; - ir_constant *one; - - switch (ir->type->base_type) { - case GLSL_TYPE_FLOAT16: - one = new(mem_ctx) ir_constant(float16_t::one(), op2_components); - break; - case GLSL_TYPE_FLOAT: - one = new(mem_ctx) ir_constant(1.0f, op2_components); - break; - case GLSL_TYPE_DOUBLE: - one = new(mem_ctx) ir_constant(1.0, op2_components); - break; - default: - one = NULL; - unreachable("unexpected type"); - } - - return mul(ir->operands[0], add(one, neg(ir->operands[2]))); - } - break; - /* Remove interpolateAt* instructions for demoted inputs. They are * assigned a constant expression to facilitate this. */