Re: lower subreg optimization

2010-04-09 Thread Jim Wilson
On 04/07/2010 10:48 PM, roy rosen wrote: I saw in arm/neon.md that they have a similar problem: ... Their solution is also not complete. What is the proper way to handle such a case and how do I let gcc know that this is a simple move instruction so that gcc would be able to optimize it out? Th

Re: lower subreg optimization

2010-04-07 Thread roy rosen
2010/4/6, Jim Wilson : > On 04/06/2010 02:24 AM, roy rosen wrote: > > (insn 33 32 34 7 a.c:25 (set (subreg:V2HI (reg:V4HI 114) 0) > > (plus:V2HI (subreg:V2HI (reg:V4HI 112) 0) > > (subreg:V2HI (reg:V4HI 113) 0))) 118 {addv2hi3} (nil)) > > > > Only subregs are decomposed. So use

Re: lower subreg optimization

2010-04-06 Thread Joseph S. Myers
On Tue, 6 Apr 2010, Ian Lance Taylor wrote: > This code is sort of weird, though; why the conversion from DImode to > DFmode? See for discussion of the e500 subregs and their semantics. I made them work reliably (for 4.3 and later, 4.4

Re: lower subreg optimization

2010-04-06 Thread Nathan Froyd
On Tue, Apr 06, 2010 at 11:55:01AM -0700, Ian Lance Taylor wrote: > Nathan Froyd writes: > > Compiling anything that uses doubles on powerpc e500v2 produces awful > > code due in part to lower-subregs (the register allocator doesn't help, > > either, but that's a different story). > > I doubt tha

Re: lower subreg optimization

2010-04-06 Thread Ian Lance Taylor
Nathan Froyd writes: > Compiling anything that uses doubles on powerpc e500v2 produces awful > code due in part to lower-subregs (the register allocator doesn't help, > either, but that's a different story). Code that looks like: > > rY:DI = r:DI > rX:DI = rY:DI > (subreg:DF rZ:DI 0) = rX:

Re: lower subreg optimization

2010-04-06 Thread Steven Bosscher
On Tue, Apr 6, 2010 at 7:12 PM, Nathan Froyd wrote: > I realize > e500v2 is not exactly a mainstream target, but perhaps a target hook is > appropriate here Big hammer. Preferred tool for jobs in the real world. >  I suppose checking costs might achieve the same > thing. Small hammer. Preferred

Re: lower subreg optimization

2010-04-06 Thread Nathan Froyd
On Tue, Apr 06, 2010 at 09:58:23AM -0700, Ian Lance Taylor wrote: > In the code the register is always accessed via a subreg, so the > lower-subregs pass thinks that it is OK to decompose the register. > Once it is decomposed, nothing is expected to put it back together. > > To fix this, you shoul

Re: lower subreg optimization

2010-04-06 Thread Ian Lance Taylor
roy rosen writes: > I have encountered several problems with lower subreg optimization in my port. > In some cases I noticed that insns are decomposed in subreg1 pass and > do not get recomposed later which causes at the end using two insns > instead of one. In the code the register is always ac

Re: lower subreg optimization

2010-04-06 Thread Jim Wilson
On 04/06/2010 02:24 AM, roy rosen wrote: (insn 33 32 34 7 a.c:25 (set (subreg:V2HI (reg:V4HI 114) 0) (plus:V2HI (subreg:V2HI (reg:V4HI 112) 0) (subreg:V2HI (reg:V4HI 113) 0))) 118 {addv2hi3} (nil)) Only subregs are decomposed. So use vec_select instead of subreg. I see