combine.c (simplify_shift_const): (lshiftrt (truncate (lshiftrt))) is (truncate (lshiftrt)).

* combine.c (simplify_shift_const):  (lshiftrt (truncate (lshiftrt)))
        is (truncate (lshiftrt)).

From-SVN: r17570
This commit is contained in:
John Carr 1998-02-01 01:49:32 +00:00 committed by Jeff Law
parent 8821a725d6
commit 6e0ef100da
2 changed files with 27 additions and 0 deletions

View file

@ -1,3 +1,8 @@
Sun Feb 1 02:50:46 1998 John Carr <jfc@mit.edu>
* combine.c (simplify_shift_const): (lshiftrt (truncate (lshiftrt)))
is (truncate (lshiftrt)).
Sun Feb 1 01:06:53 1998 Richard Henderson <rth@cygnus.com>
* alpha.c (alpha_expand_unaligned_load): Use expand_binop properly.

View file

@ -8787,6 +8787,28 @@ simplify_shift_const (x, code, result_mode, varop, count)
continue;
}
break;
case TRUNCATE:
/* Change (lshiftrt (truncate (lshiftrt))) to (truncate (lshiftrt))
if the truncate does not affect the value. */
if (code == LSHIFTRT
&& GET_CODE (XEXP (varop, 0)) == LSHIFTRT
&& GET_CODE (XEXP (XEXP (varop, 0), 1)) == CONST_INT
&& (INTVAL (XEXP (XEXP (varop, 0), 1))
>= (GET_MODE_BITSIZE (GET_MODE (XEXP (varop, 0))) - GET_MODE_BITSIZE (varop))))
{
rtx varop_inner = XEXP (varop, 0);
varop_inner = gen_rtx_combine (LSHIFTRT,
GET_MODE (varop_inner),
XEXP (varop_inner, 0),
GEN_INT (count + INTVAL (XEXP (varop_inner, 1))));
varop = gen_rtx_combine (TRUNCATE, GET_MODE (varop),
varop_inner);
count = 0;
continue;
}
break;
default:
break;