This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Optimize nested SIGN_EXTENDs/ZERO_EXTENDs (PR target/45336)
- From: Paolo Bonzini <bonzini at gnu dot org>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Fri, 20 Aug 2010 11:46:48 +0200
- Subject: Re: [PATCH] Optimize nested SIGN_EXTENDs/ZERO_EXTENDs (PR target/45336)
- References: <20100819163330.GX702@tyan-ft48-01.lab.bos.redhat.com>
On 08/19/2010 06:33 PM, Jakub Jelinek wrote:
+ /* (sign_extend:M (sign_extend:N<X>)) is (sign_extend:M<X>). */
+ if (GET_CODE (op) == SIGN_EXTEND)
+ return simplify_gen_unary (SIGN_EXTEND, mode, XEXP (op, 0),
+ GET_MODE (XEXP (op, 0)));
Maybe
/* (sign_extend:M (sign_extend:N<X>)) is (sign_extend:M<X>).
(sign_extend:M (zero_extend:N<X>)) is (zero_extend:M<X>). */
if (GET_CODE (op) == SIGN_EXTEND || GET_CODE (op) == ZERO_EXTEND)
{
gcc_assert (GET_MODE (op) != mode);
return simplify_gen_unary (GET_CODE (op), mode, XEXP (op, 0),
GET_MODE (XEXP (op, 0)));
}
?
Paolo