simplify-rtx.c (mode_signbit_p): New function to check whether an RTX is an immediate...
authorRoger Sayle <roger@eyesopen.com>
Fri, 9 Apr 2004 21:39:14 +0000 (21:39 +0000)
committerRoger Sayle <sayle@gcc.gnu.org>
Fri, 9 Apr 2004 21:39:14 +0000 (21:39 +0000)
commit0b24db885b67a354b09746a9af49a5b4333cc249
tree48b3dead6c152c128f09b4ca6fa75231cacb39d9
parentce58118c3d596e5732e17cbca57b6e7518b50d70
simplify-rtx.c (mode_signbit_p): New function to check whether an RTX is an immediate constant that represents...

* simplify-rtx.c (mode_signbit_p): New function to check whether
an RTX is an immediate constant that represents the most significant
bit of a given machine mode.
(simplify_unary_operation) <NOT>: Optimize ~(X+C) as X ^ ~C, where
C is the sign bit.
(simplify_binary_operation) <PLUS>: Optimize (X^C1) + C2 as X^(C1^C2)
when C2 is the sign bit.
(simplify_binary_operation) <XOR>: Canonicalize X^C as X+C when C
is the sign bit.  Optimize (X+C1) ^ C2 as X^(C1^C2) when C1 is the
sign bit.

* gcc.c-torture/execute/20040409-1.c: New test case.
* gcc.c-torture/execute/20040409-2.c: New test case.
* gcc.c-torture/execute/20040409-3.c: New test case.

From-SVN: r80568
gcc/ChangeLog
gcc/simplify-rtx.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.c-torture/execute/20040409-1.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/20040409-2.c [new file with mode: 0644]
gcc/testsuite/gcc.c-torture/execute/20040409-3.c [new file with mode: 0644]