mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-30 20:50:09 +01:00
glsl: Apply the transformation "(a ^^ a) -> false" in opt_algebraic.
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
This commit is contained in:
parent
58a98d32e4
commit
477f8cd08b
1 changed files with 3 additions and 1 deletions
|
|
@ -377,7 +377,6 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
|
|||
break;
|
||||
|
||||
case ir_binop_logic_xor:
|
||||
/* FINISHME: Also simplify (a ^^ a) to (false). */
|
||||
if (is_vec_zero(op_const[0])) {
|
||||
return ir->operands[1];
|
||||
} else if (is_vec_zero(op_const[1])) {
|
||||
|
|
@ -386,6 +385,9 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
|
|||
return logic_not(ir->operands[1]);
|
||||
} else if (is_vec_one(op_const[1])) {
|
||||
return logic_not(ir->operands[0]);
|
||||
} else if (ir->operands[0]->equals(ir->operands[1])) {
|
||||
/* (a ^^ a) == false */
|
||||
return ir_constant::zero(mem_ctx, ir->type);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue