diff options
author | Eric Anholt <[email protected]> | 2013-11-07 12:10:25 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2013-11-15 11:33:07 -0800 |
commit | 477f8cd08bb8467d28fdfd6c25fe358957e3da58 (patch) | |
tree | 1e4fd78ce793972aa0a4d8d3b42a5572fa9cc1b7 /src/glsl/opt_algebraic.cpp | |
parent | 58a98d32e451762934ca8c38135357f36e29654f (diff) |
glsl: Apply the transformation "(a ^^ a) -> false" in opt_algebraic.
Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/glsl/opt_algebraic.cpp')
-rw-r--r-- | src/glsl/opt_algebraic.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/glsl/opt_algebraic.cpp b/src/glsl/opt_algebraic.cpp index ea3c386edf6..448f27ed954 100644 --- a/src/glsl/opt_algebraic.cpp +++ b/src/glsl/opt_algebraic.cpp @@ -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; |