This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)
- From: Richard Henderson <rth at redhat dot com>
- To: Georg-Johann Lay <avr at gjlay dot de>
- Cc: gcc-patches at gcc dot gnu dot org, Anatoly Sokolov <aesok at post dot ru>, Denis Chertykov <chertykov at gmail dot com>, Eric Weddington <eric dot weddington at atmel dot com>
- Date: Tue, 26 Jul 2011 08:26:25 -0700
- Subject: Re: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)
- References: <4E2DA83B.3090002@gjlay.de> <4E2DAC23.6090606@redhat.com> <4E2E8D6F.4000806@gjlay.de>
On 07/26/2011 02:48 AM, Georg-Johann Lay wrote:
> Moreover, the original peep2 is not fully correct because it
> maps a 16-bit shift to a 8-bit one. The correct mapping is
>
> (set (match_dup 2)
> (subreg:QI (ashift:HI (zero_extend:HI (match_dup 2))
> (match_dup 1))
> 0))
>
> instead of
>
> (set (match_dup 2)
> (ashift:QI (match_dup 2)
> (match_dup 1)))
>
>
> I don't think it makes a difference that late in the
> compilation process, yet I prefer correct semantics.
Why do you think the semantics were wrong? As long as you
don't define SHIFT_COUNT_TRUNCATES, these are equivalent.
r~