aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorPat Haugen <pthaugen@us.ibm.com>2004-10-18 18:46:06 +0000
committerDavid Edelsohn <dje@gcc.gnu.org>2004-10-18 14:46:06 -0400
commitb757b9f8b210b691f72fe418db8c0767bda54cb7 (patch)
tree4c36b35633d0f938381ebc4187f4b32439f4546d /gcc/combine.c
parent1a1804c27017289c540fd8b193209a8598af858a (diff)
downloadgcc-b757b9f8b210b691f72fe418db8c0767bda54cb7.zip
gcc-b757b9f8b210b691f72fe418db8c0767bda54cb7.tar.gz
gcc-b757b9f8b210b691f72fe418db8c0767bda54cb7.tar.bz2
simplify-rtx.c (mode_signbit_p): Externalize function...
2004-10-18 Pat Haugen <pthaugen@us.ibm.com> * simplify-rtx.c (mode_signbit_p): Externalize function... * rtl.h (mode_signbit_p): ... to here. * combine.c (simplify_shift_const): Recognize PLUS signbit as canonical form of XOR signbit and move to outer op. From-SVN: r89235
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 559ee15..98efe3e 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -9022,6 +9022,26 @@ simplify_shift_const (rtx x, enum rtx_code code,
varop = XEXP (varop, 0);
continue;
}
+
+ /* Check for 'PLUS signbit', which is the canonical form of 'XOR
+ signbit', and attempt to change the PLUS to an XOR and move it to
+ the outer operation as is done above in the AND/IOR/XOR case
+ leg for shift(logical). See details in logical handling above
+ for reasoning in doing so. */
+ if (code == LSHIFTRT
+ && GET_CODE (XEXP (varop, 1)) == CONST_INT
+ && mode_signbit_p (result_mode, XEXP (varop, 1))
+ && (new = simplify_binary_operation (code, result_mode,
+ XEXP (varop, 1),
+ GEN_INT (count))) != 0
+ && GET_CODE (new) == CONST_INT
+ && merge_outer_ops (&outer_op, &outer_const, XOR,
+ INTVAL (new), result_mode, &complement_p))
+ {
+ varop = XEXP (varop, 0);
+ continue;
+ }
+
break;
case MINUS: