Commit af563d4b by Marc Glisse Committed by Marc Glisse

match.pd ((x | y) & ~x -> y & ~x, (x & y) | ~x -> y | ~x): New simplifications.

2015-05-22  Marc Glisse  <marc.glisse@inria.fr>

gcc/
	* match.pd ((x | y) & ~x -> y & ~x, (x & y) | ~x -> y | ~x): New
	simplifications.
gcc/testsuite/
	* gcc.dg/nand.c: New testcase.

From-SVN: r223587
parent ddc75e8b
2015-05-22 Marc Glisse <marc.glisse@inria.fr>
* match.pd ((x | y) & ~x -> y & ~x, (x & y) | ~x -> y | ~x): New
simplifications.
2015-05-22 Jeff Law <law@redhat.com> 2015-05-22 Jeff Law <law@redhat.com>
* config/pa/pa.md (integer_indexed_store splitters): Use * config/pa/pa.md (integer_indexed_store splitters): Use
......
...@@ -280,10 +280,18 @@ along with GCC; see the file COPYING3. If not see ...@@ -280,10 +280,18 @@ along with GCC; see the file COPYING3. If not see
/* x & ~(x & y) -> x & ~y */ /* x & ~(x & y) -> x & ~y */
/* x | ~(x | y) -> x | ~y */ /* x | ~(x | y) -> x | ~y */
(for bitop (bit_and bit_ior) (for bitop (bit_and bit_ior)
(simplify (simplify
(bitop:c @0 (bit_not (bitop:c@2 @0 @1))) (bitop:c @0 (bit_not (bitop:c@2 @0 @1)))
(if (TREE_CODE (@2) != SSA_NAME || has_single_use (@2)) (if (TREE_CODE (@2) != SSA_NAME || has_single_use (@2))
(bitop @0 (bit_not @1))))) (bitop @0 (bit_not @1)))))
/* (x | y) & ~x -> y & ~x */
/* (x & y) | ~x -> y | ~x */
(for bitop (bit_and bit_ior)
rbitop (bit_ior bit_and)
(simplify
(bitop:c (rbitop:c @0 @1) (bit_not@2 @0))
(bitop @1 @2)))
(simplify (simplify
(abs (negate @0)) (abs (negate @0))
......
2015-05-22 Marc Glisse <marc.glisse@inria.fr>
* gcc.dg/nand.c: New testcase.
2015-05-22 Sandra Loosemore <sandra@codesourcery.com> 2015-05-22 Sandra Loosemore <sandra@codesourcery.com>
* gcc.target/aarch64/advsimd-intrinsics/advsimd-intrinsics.exp: * gcc.target/aarch64/advsimd-intrinsics/advsimd-intrinsics.exp:
......
/* { dg-do compile } */
/* { dg-options "-O -fdump-tree-original" } */
unsigned f(unsigned x, unsigned y){
return (x | y) & ~x;
}
unsigned g(unsigned x, unsigned y){
return ~x & (y | x);
}
/* { dg-final { scan-tree-dump-times "return ~x & y;" 2 "original" } } */
/* { dg-final { cleanup-tree-dump "original" } } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment