Commit 6e0ef100 by John Carr Committed by Jeff Law

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
parent 8821a725
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.
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment