Re: Ping #1: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-08-09 Thread Denis Chertykov
2011/8/10 Georg-Johann Lay : > This patch is still pending review: > > http://gcc.gnu.org/ml/gcc-patches/2011-07/msg02376.html > > Georg-Johann Lay a écrit: >> >> [...] >> >> So here is a cleaned up version that maps to QI shifts. >> >> Tested without regressions. >> >> Ok? Ok. Denis.

Ping #1: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-08-09 Thread Georg-Johann Lay
This patch is still pending review: http://gcc.gnu.org/ml/gcc-patches/2011-07/msg02376.html Georg-Johann Lay a écrit: [...] So here is a cleaned up version that maps to QI shifts. Tested without regressions. Ok? Johann PR target/29560 * config/avr/avr.md (any_extend): New

Re: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-07-29 Thread Georg-Johann Lay
Richard Henderson wrote: > On 07/27/2011 10:00 AM, Georg-Johann Lay wrote: >> Richard Henderson wrote: +;; "*ashluqihiqi3.mem" +;; "*ashlsqihiqi3.mem" +(define_insn_and_split "*ashlqihiqi3.mem" + [(set (match_operand:QI 0 "memory_operand" "=m") +(subreg:QI (ashift:

Re: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-07-28 Thread Richard Henderson
On 07/27/2011 10:00 AM, Georg-Johann Lay wrote: > Richard Henderson wrote: >>> +;; "*ashluqihiqi3.mem" >>> +;; "*ashlsqihiqi3.mem" >>> +(define_insn_and_split "*ashlqihiqi3.mem" >>> + [(set (match_operand:QI 0 "memory_operand" "=m") >>> +(subreg:QI (ashift:HI (any_extend:HI (match_operand:

Re: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-07-27 Thread Georg-Johann Lay
Richard Henderson wrote: >> +;; "*ashluqihiqi3.mem" >> +;; "*ashlsqihiqi3.mem" >> +(define_insn_and_split "*ashlqihiqi3.mem" >> + [(set (match_operand:QI 0 "memory_operand" "=m") >> +(subreg:QI (ashift:HI (any_extend:HI (match_operand:QI 1 >> "register_operand" "r")) >> +

Re: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-07-27 Thread Richard Henderson
> +;; "*ashluqihiqi3.mem" > +;; "*ashlsqihiqi3.mem" > +(define_insn_and_split "*ashlqihiqi3.mem" > + [(set (match_operand:QI 0 "memory_operand" "=m") > +(subreg:QI (ashift:HI (any_extend:HI (match_operand:QI 1 > "register_operand" "r")) > + (match_operand:QI 2

Re: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-07-27 Thread Georg-Johann Lay
Joseph S. Myers wrote: > On Tue, 26 Jul 2011, Georg-Johann Lay wrote: > >> I once ran into trouble because there seems to be no clear >> separation between undefinedness in C and undefinedness in RTL >> >> Starting thread from here, >> http://gcc.gnu.org/ml/gcc-help/2010-06/msg00191.html >> >> t

Re: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-07-26 Thread Joseph S. Myers
On Tue, 26 Jul 2011, Georg-Johann Lay wrote: > I once ran into trouble because there seems to be no clear > separation between undefinedness in C and undefinedness in RTL > > Starting thread from here, > http://gcc.gnu.org/ml/gcc-help/2010-06/msg00191.html > > the treads comes to this > http

Re: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-07-26 Thread Georg-Johann Lay
Richard Henderson wrote: > On 07/26/2011 10:26 AM, Georg-Johann Lay wrote: >> If -mint8 (word_mode = QImode) ever returns resp. is turned >> functional again, then the QI version is undefined for >> offsets >= 8 whereas the HI version is only undefined for >> offsets >= 16. > > It's undefined at

Re: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-07-26 Thread Richard Henderson
On 07/26/2011 10:26 AM, Georg-Johann Lay wrote: > If -mint8 (word_mode = QImode) ever returns resp. is turned > functional again, then the QI version is undefined for > offsets >= 8 whereas the HI version is only undefined for > offsets >= 16. It's undefined at the C level, not necessarily at the

Re: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-07-26 Thread Georg-Johann Lay
Richard Henderson wrote: > 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)) >>

Re: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-07-26 Thread Richard Henderson
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)

Re: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-07-26 Thread Georg-Johann Lay
http://gcc.gnu.org/ml/gcc-patches/2011-07/msg02186.html Richard Henderson wrote: > On 07/25/2011 10:30 AM, Georg-Johann Lay wrote: >> PR target/29560 >> * config/avr/avr.md: Add peephole2 to map ashlhi3 to ashlqi3 if >> high part of shift target is unused. > > Ok. > > r~ Here is

Re: [Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-07-25 Thread Richard Henderson
On 07/25/2011 10:30 AM, Georg-Johann Lay wrote: > PR target/29560 > * config/avr/avr.md: Add peephole2 to map ashlhi3 to ashlqi3 if > high part of shift target is unused. Ok. r~

[Patch,AVR]: Fix PR29560 (map 16-bit shift to 8-bit)

2011-07-25 Thread Georg-Johann Lay
This is an optimization for 8-bit shifts if the high part is unused. Variable shift offset shifts are tedious on AVR because these devices can just shift by 1. If the high part of a shift is unused, the high part need not to be computed, i.e. the 16-bit shift can be mapped to a 8-bit shift. Most