Re: [PATCH][PR target/79170] fix memcmp builtin expansion sequence for rs6000 target.

2017-01-31 Thread Segher Boessenkool
On Tue, Jan 31, 2017 at 01:42:31PM +0100, Christophe Lyon wrote: > The updated test does not link when using newlib, missing random(). > > The small attached patch fixes this by calling rand() instead. > Tested on arm-none-eabi, aarch64-elf. > > OK? > > Christophe Okay, thanks! Segher >

Re: [PATCH][PR target/79170] fix memcmp builtin expansion sequence for rs6000 target.

2017-01-31 Thread Christophe Lyon
Hi, On 30 January 2017 at 17:00, Peter Bergner wrote: > On 1/27/17 5:43 PM, Segher Boessenkool wrote: >> >> On Fri, Jan 27, 2017 at 12:11:05PM -0600, Aaron Sawdey wrote: >>> >>> +addi 9,4,7 >>> +lwbrx 10,0,9 >>> +addi 9,5,7 >>> +

Re: [PATCH][PR target/79170] fix memcmp builtin expansion sequence for rs6000 target.

2017-01-30 Thread Peter Bergner
On 1/27/17 5:43 PM, Segher Boessenkool wrote: On Fri, Jan 27, 2017 at 12:11:05PM -0600, Aaron Sawdey wrote: +addi 9,4,7 +lwbrx 10,0,9 +addi 9,5,7 +lwbrx 9,0,9 It would be nice if this was li 9,7 lwbrx 10,9,4 lwbrx 9,9,5

Re: [PATCH][PR target/79170] fix memcmp builtin expansion sequence for rs6000 target.

2017-01-27 Thread Segher Boessenkool
On Fri, Jan 27, 2017 at 12:11:05PM -0600, Aaron Sawdey wrote: > The updated memcmp-1 testcase passes on ppc64le (p8/p9), ppc64 (p8/p9), > ppc32 (p8), and x86_64. Bootstrap was successful on ppc64/ppc64le. > Assuming regtest on ppc64/ppc64le passes, ok for trunk? > + ldbrx 10,6,9 > +

[PATCH][PR target/79170] fix memcmp builtin expansion sequence for rs6000 target.

2017-01-27 Thread Aaron Sawdey
This patch changes the generated sequence for builtin expansion of memcmp to one that is actually correct. The old sequence did not work right if the subf overflowed subtracting two 64-bit chunks, or if extsw overflowed after subtraction of two 32-bit chunks. Included is an expansion of the