summaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1995-04-26 18:08:54 +0000
committerwilson <wilson@138bc75d-0d04-0410-961f-82ee72b054a4>1995-04-26 18:08:54 +0000
commitd5229fd0816ffcde8b1f11feeaa35a9f2ea35e0a (patch)
treed9c614c004c1aa870cd6174e671d12776048e902 /gcc/combine.c
parent91ebac800f27576c0832129d7d1e980905e0ee13 (diff)
downloadgcc-d5229fd0816ffcde8b1f11feeaa35a9f2ea35e0a.tar.gz
(simplify_rtx, case TRUNCATE): Add. Use force_to_mode.
(force_to_mode, case AND): Allow some simplifications when GET_MODE (x) has more bits than HOST_BITS_PER_WIDE_INT. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9479 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 9d355cbffed..827141c2e5f 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -3447,6 +3447,13 @@ simplify_rtx (x, op0_mode, last, in_dest)
}
break;
+ case TRUNCATE:
+ if (GET_MODE_BITSIZE (mode) <= HOST_BITS_PER_WIDE_INT)
+ SUBST (XEXP (x, 0),
+ force_to_mode (XEXP (x, 0), GET_MODE (XEXP (x, 0)),
+ GET_MODE_MASK (mode), NULL_RTX, 0));
+ break;
+
case FLOAT_TRUNCATE:
/* (float_truncate:SF (float_extend:DF foo:SF)) = foo:SF. */
if (GET_CODE (XEXP (x, 0)) == FLOAT_EXTEND
@@ -5765,8 +5772,7 @@ force_to_mode (x, mode, mask, reg, just_select)
whose constant is the AND of that constant with MASK. If it
remains an AND of MASK, delete it since it is redundant. */
- if (GET_CODE (XEXP (x, 1)) == CONST_INT
- && GET_MODE_BITSIZE (GET_MODE (x)) <= HOST_BITS_PER_WIDE_INT)
+ if (GET_CODE (XEXP (x, 1)) == CONST_INT)
{
x = simplify_and_const_int (x, op_mode, XEXP (x, 0),
mask & INTVAL (XEXP (x, 1)));
@@ -5785,7 +5791,8 @@ force_to_mode (x, mode, mask, reg, just_select)
cheaper constant. */
if (GET_CODE (x) == AND && GET_CODE (XEXP (x, 1)) == CONST_INT
- && GET_MODE_MASK (GET_MODE (x)) != mask)
+ && GET_MODE_MASK (GET_MODE (x)) != mask
+ && GET_MODE_BITSIZE (GET_MODE (x)) <= HOST_BITS_PER_WIDE_INT)
{
HOST_WIDE_INT cval = (INTVAL (XEXP (x, 1))
| (GET_MODE_MASK (GET_MODE (x)) & ~ mask));