Re: [RS6000] Fix PR61098, Poor code setting count register

2014-05-24 Thread David Edelsohn
On Fri, May 23, 2014 at 11:23 AM, Alan Modra wrote: > OK, let's start again from scratch. This patch fixes PR61098, a > problem caused by trying to do arithmetic on the count register. The > fix is to provide a new pseudo in rs6000_emit_set_long_const so > arithmetic will be done in a gpr. > > A

Re: [RS6000] Fix PR61098, Poor code setting count register

2014-05-23 Thread Alan Modra
OK, let's start again from scratch. This patch fixes PR61098, a problem caused by trying to do arithmetic on the count register. The fix is to provide a new pseudo in rs6000_emit_set_long_const so arithmetic will be done in a gpr. Additionally, the patch fixes a number of other bugs and cleanup

Re: [RS6000] Fix PR61098, Poor code setting count register

2014-05-14 Thread David Edelsohn
On Wed, May 14, 2014 at 5:56 AM, Alan Modra wrote: >> I seem to remember problems in the past with late creation of TOC >> entries for constants causing problems, so it was easier to fall back >> to materializing all integer constants inline. I don't remember the >> PRs, but I think there were is

Re: [RS6000] Fix PR61098, Poor code setting count register

2014-05-14 Thread Alan Modra
Hi David, On Tue, May 13, 2014 at 11:46:20PM -0400, David Edelsohn wrote: > Danny may have re-organized the code, but I thought that it originally > came from Tom Rixx, if not earlier. OK, I'm not trying to apportion blame. My name is on plenty of dodgy code in the rs6000 backend too. :) > I se

Re: [RS6000] Fix PR61098, Poor code setting count register

2014-05-13 Thread David Edelsohn
Alan, Danny may have re-organized the code, but I thought that it originally came from Tom Rixx, if not earlier. I seem to remember problems in the past with late creation of TOC entries for constants causing problems, so it was easier to fall back to materializing all integer constants inline. I

Re: [RS6000] Fix PR61098, Poor code setting count register

2014-05-13 Thread Alan Modra
On Sat, May 10, 2014 at 10:24:34PM -0400, David Edelsohn wrote: > On Thu, May 8, 2014 at 10:40 PM, Alan Modra wrote: > > >> Please do not remove all of the comments from the two functions. The > >> comments should provide some documentation about the different > >> purposes of the two functions o

Re: [RS6000] Fix PR61098, Poor code setting count register

2014-05-11 Thread Alan Modra
On Mon, May 12, 2014 at 08:23:16AM +0930, Alan Modra wrote: > On Sat, May 10, 2014 at 10:24:34PM -0400, David Edelsohn wrote: > > On Thu, May 8, 2014 at 10:40 PM, Alan Modra wrote: > > > rs6000_emit_set_const ... always returns a non-zero result ... > > > > Can you help clarify the removal of the

Re: [RS6000] Fix PR61098, Poor code setting count register

2014-05-11 Thread Alan Modra
On Sat, May 10, 2014 at 10:24:34PM -0400, David Edelsohn wrote: > On Thu, May 8, 2014 at 10:40 PM, Alan Modra wrote: > > rs6000_emit_set_const ... always returns a non-zero result ... > > Can you help clarify the removal of the code that tests if the > splitter failed? See above. -- Alan Modra

Re: [RS6000] Fix PR61098, Poor code setting count register

2014-05-10 Thread David Edelsohn
On Thu, May 8, 2014 at 10:40 PM, Alan Modra wrote: >> Please do not remove all of the comments from the two functions. The >> comments should provide some documentation about the different >> purposes of the two functions other than setting DEST to a CONST. > > I believe my updated comment covers

Re: [RS6000] Fix PR61098, Poor code setting count register

2014-05-08 Thread Alan Modra
On Thu, May 08, 2014 at 09:48:35AM -0400, David Edelsohn wrote: > The history is 32 bit HWI. Right. > The ChangeLog does not mention the changes to rs6000.md nor rs6000-protos.h. Oops, added. * config/rs6000/rs6000.md (movsi_internal1_single+1): Update call to rs6000_emit_set_co

Re: [RS6000] Fix PR61098, Poor code setting count register

2014-05-08 Thread David Edelsohn
On Wed, May 7, 2014 at 9:48 PM, Alan Modra wrote: > On powerpc64, to set a large loop count we have code like the > following after split1: > > (insn 67 14 68 4 (set (reg:DI 160) > (const_int 99942400 [0x5f5])) /home/amodra/unaligned_load.c:14 -1 > (nil)) > (insn 68 67 42 4 (set (

[RS6000] Fix PR61098, Poor code setting count register

2014-05-07 Thread Alan Modra
On powerpc64, to set a large loop count we have code like the following after split1: (insn 67 14 68 4 (set (reg:DI 160) (const_int 99942400 [0x5f5])) /home/amodra/unaligned_load.c:14 -1 (nil)) (insn 68 67 42 4 (set (reg:DI 160) (ior:DI (reg:DI 160) (const_int