mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-11-30 15:24:07 +08:00
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
This commit is contained in:
parent
ddc75e8baf
commit
af563d4bb7
@ -1,3 +1,8 @@
|
||||
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>
|
||||
|
||||
* config/pa/pa.md (integer_indexed_store splitters): Use
|
||||
|
16
gcc/match.pd
16
gcc/match.pd
@ -280,10 +280,18 @@ along with GCC; see the file COPYING3. If not see
|
||||
/* x & ~(x & y) -> x & ~y */
|
||||
/* x | ~(x | y) -> x | ~y */
|
||||
(for bitop (bit_and bit_ior)
|
||||
(simplify
|
||||
(bitop:c @0 (bit_not (bitop:c@2 @0 @1)))
|
||||
(if (TREE_CODE (@2) != SSA_NAME || has_single_use (@2))
|
||||
(bitop @0 (bit_not @1)))))
|
||||
(simplify
|
||||
(bitop:c @0 (bit_not (bitop:c@2 @0 @1)))
|
||||
(if (TREE_CODE (@2) != SSA_NAME || has_single_use (@2))
|
||||
(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
|
||||
(abs (negate @0))
|
||||
|
@ -1,3 +1,7 @@
|
||||
2015-05-22 Marc Glisse <marc.glisse@inria.fr>
|
||||
|
||||
* gcc.dg/nand.c: New testcase.
|
||||
|
||||
2015-05-22 Sandra Loosemore <sandra@codesourcery.com>
|
||||
|
||||
* gcc.target/aarch64/advsimd-intrinsics/advsimd-intrinsics.exp:
|
||||
|
12
gcc/testsuite/gcc.dg/nand.c
Normal file
12
gcc/testsuite/gcc.dg/nand.c
Normal file
@ -0,0 +1,12 @@
|
||||
/* { 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" } } */
|
Loading…
Reference in New Issue
Block a user