Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-15 Thread Uros Bizjak
On Tue, Aug 13, 2019 at 9:54 PM H.J. Lu wrote: > > > with the latest patch (this is with -m32) where -mstv causes > > > all spills to go away and the cmoves replaced (so clearly > > > better code after the patch) for pr65105-5.c, no obvious > > > improvements for pr65105-3.c where cmov does

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-14 Thread Uros Bizjak
On Wed, Aug 14, 2019 at 11:08 AM Richard Biener wrote: > > On Tue, 13 Aug 2019, Jeff Law wrote: > > > On 8/9/19 7:00 AM, Richard Biener wrote: > > > > > > It fixes the slowdown observed in 416.gamess and 464.h264ref. > > > > > > Bootstrapped on x86_64-unknown-linux-gnu, testing still in progress.

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-14 Thread Richard Biener
On Tue, 13 Aug 2019, Jeff Law wrote: > On 8/9/19 7:00 AM, Richard Biener wrote: > > > > It fixes the slowdown observed in 416.gamess and 464.h264ref. > > > > Bootstrapped on x86_64-unknown-linux-gnu, testing still in progress. > > > > CCing Jeff who "knows RTL". > What specifically do you want

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-13 Thread H.J. Lu
On Tue, Aug 13, 2019 at 8:20 AM Jeff Law wrote: > > On 8/12/19 6:27 AM, Richard Biener wrote: > > On Fri, 9 Aug 2019, Uros Bizjak wrote: > > > >> On Fri, Aug 9, 2019 at 3:00 PM Richard Biener wrote: > >> > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-13 Thread Jeff Law
On 8/12/19 6:27 AM, Richard Biener wrote: > On Fri, 9 Aug 2019, Uros Bizjak wrote: > >> On Fri, Aug 9, 2019 at 3:00 PM Richard Biener wrote: >> (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI "TARGET_AVX512F"]) and then we need to

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-13 Thread Jeff Law
On 8/9/19 7:00 AM, Richard Biener wrote: > On Fri, 9 Aug 2019, Richard Biener wrote: > >> On Fri, 9 Aug 2019, Richard Biener wrote: >> >>> On Fri, 9 Aug 2019, Uros Bizjak wrote: >>> On Mon, Aug 5, 2019 at 3:09 PM Uros Bizjak wrote: >> (define_mode_iterator MAXMIN_IMODE [SI

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-12 Thread Uros Bizjak
On Mon, Aug 12, 2019 at 2:27 PM Richard Biener wrote: > > On Fri, 9 Aug 2019, Uros Bizjak wrote: > > > On Fri, Aug 9, 2019 at 3:00 PM Richard Biener wrote: > > > > > > > > > > > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] > > > > > > > > > > > > [DI "TARGET_AVX512F"]) > > > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-12 Thread Richard Biener
On Fri, 9 Aug 2019, Uros Bizjak wrote: > On Fri, Aug 9, 2019 at 3:00 PM Richard Biener wrote: > > > > > > > > > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] > > > > > > > > > > > [DI "TARGET_AVX512F"]) > > > > > > > > > > > > > > > > > > > > > > and then we need to split

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-09 Thread Jeff Law
On 7/27/19 3:22 AM, Uros Bizjak wrote: > On Wed, Jul 24, 2019 at 5:03 PM Jeff Law wrote: > >>> Clearly this approach will run into register allocation issues >>> but it looks cleaner than writing yet another STV-like pass >>> (STV itself is quite awkwardly structured so I refrain from >>>

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-09 Thread Uros Bizjak
On Fri, Aug 9, 2019 at 3:00 PM Richard Biener wrote: > > > > > > > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI > > > > > > > > > > "TARGET_AVX512F"]) > > > > > > > > > > > > > > > > > > > > and then we need to split DImode for 32bits, too. > > > > > > > > > > > > > > > > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-09 Thread Richard Biener
On Fri, 9 Aug 2019, Richard Biener wrote: > On Fri, 9 Aug 2019, Richard Biener wrote: > > > On Fri, 9 Aug 2019, Uros Bizjak wrote: > > > > > On Mon, Aug 5, 2019 at 3:09 PM Uros Bizjak wrote: > > > > > > > > > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI > > > > > > > > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-09 Thread Richard Biener
On Fri, 9 Aug 2019, Jakub Jelinek wrote: > On Fri, Aug 09, 2019 at 11:25:30AM +0200, Richard Biener wrote: > > 0.65 │1e0: vpxor %xmm0,%xmm0,%xmm0 > > 0.32 │ vpmaxs -0x10(%rsp),%xmm0,%xmm0 > > 40.45 │ vmovd %xmm0,%eax > > 2.45 │ imul %r8d,%eax > > Shouldn't we hoist

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-09 Thread Richard Biener
On Fri, 9 Aug 2019, Richard Biener wrote: > On Fri, 9 Aug 2019, Uros Bizjak wrote: > > > On Mon, Aug 5, 2019 at 3:09 PM Uros Bizjak wrote: > > > > > > > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI > > > > > > > > "TARGET_AVX512F"]) > > > > > > > > > > > > > > > > and

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-09 Thread Jakub Jelinek
On Fri, Aug 09, 2019 at 11:25:30AM +0200, Richard Biener wrote: > 0.65 │1e0: vpxor %xmm0,%xmm0,%xmm0 > 0.32 │ vpmaxs -0x10(%rsp),%xmm0,%xmm0 > 40.45 │ vmovd %xmm0,%eax > 2.45 │ imul %r8d,%eax Shouldn't we hoist the vpxor before the loop? Is it STV being done too

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-09 Thread Richard Biener
On Fri, 9 Aug 2019, Uros Bizjak wrote: > On Mon, Aug 5, 2019 at 3:09 PM Uros Bizjak wrote: > > > > > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI > > > > > > > "TARGET_AVX512F"]) > > > > > > > > > > > > > > and then we need to split DImode for 32bits, too. > > > > > > > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-09 Thread Uros Bizjak
On Mon, Aug 5, 2019 at 3:09 PM Uros Bizjak wrote: > > > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI > > > > > > "TARGET_AVX512F"]) > > > > > > > > > > > > and then we need to split DImode for 32bits, too. > > > > > > > > > > For now, please add "TARGET_64BIT &&

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-08 Thread Jeff Law
On 8/5/19 6:32 AM, Uros Bizjak wrote: > On Mon, Aug 5, 2019 at 1:50 PM Richard Biener wrote: >> >> On Sun, 4 Aug 2019, Uros Bizjak wrote: >> >>> On Sat, Aug 3, 2019 at 7:26 PM Richard Biener wrote: On Thu, 1 Aug 2019, Uros Bizjak wrote: > On Thu, Aug 1, 2019 at 11:28 AM

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-07 Thread Richard Biener
On Wed, 7 Aug 2019, Richard Biener wrote: > On Mon, 5 Aug 2019, Uros Bizjak wrote: > > > On Mon, Aug 5, 2019 at 3:29 PM Richard Biener wrote: > > > > > > > > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI > > > > > > > > > "TARGET_AVX512F"]) > > > > > > > > > > > > > > > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-07 Thread Uros Bizjak
On Wed, Aug 7, 2019 at 2:52 PM Richard Biener wrote: > > On Wed, 7 Aug 2019, Uros Bizjak wrote: > > > On Wed, Aug 7, 2019 at 2:20 PM Uros Bizjak wrote: > > > > > > On Wed, Aug 7, 2019 at 1:51 PM Richard Biener wrote: > > > > > > > > On Wed, 7 Aug 2019, Richard Biener wrote: > > > > > > > > > On

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-07 Thread Richard Biener
On Wed, 7 Aug 2019, Uros Bizjak wrote: > On Wed, Aug 7, 2019 at 2:20 PM Uros Bizjak wrote: > > > > On Wed, Aug 7, 2019 at 1:51 PM Richard Biener wrote: > > > > > > On Wed, 7 Aug 2019, Richard Biener wrote: > > > > > > > On Mon, 5 Aug 2019, Uros Bizjak wrote: > > > > > > > > > On Mon, Aug 5,

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-07 Thread Uros Bizjak
On Wed, Aug 7, 2019 at 2:20 PM Uros Bizjak wrote: > > On Wed, Aug 7, 2019 at 1:51 PM Richard Biener wrote: > > > > On Wed, 7 Aug 2019, Richard Biener wrote: > > > > > On Mon, 5 Aug 2019, Uros Bizjak wrote: > > > > > > > On Mon, Aug 5, 2019 at 3:29 PM Richard Biener wrote: > > > > > > > > > > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-07 Thread Uros Bizjak
On Wed, Aug 7, 2019 at 1:51 PM Richard Biener wrote: > > On Wed, 7 Aug 2019, Richard Biener wrote: > > > On Mon, 5 Aug 2019, Uros Bizjak wrote: > > > > > On Mon, Aug 5, 2019 at 3:29 PM Richard Biener wrote: > > > > > > > > > > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-07 Thread Uros Bizjak
On Wed, Aug 7, 2019 at 1:51 PM Richard Biener wrote: > > On Wed, 7 Aug 2019, Richard Biener wrote: > > > On Mon, 5 Aug 2019, Uros Bizjak wrote: > > > > > On Mon, Aug 5, 2019 at 3:29 PM Richard Biener wrote: > > > > > > > > > > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-07 Thread Richard Biener
On Wed, 7 Aug 2019, Richard Biener wrote: > On Mon, 5 Aug 2019, Uros Bizjak wrote: > > > On Mon, Aug 5, 2019 at 3:29 PM Richard Biener wrote: > > > > > > > > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI > > > > > > > > > "TARGET_AVX512F"]) > > > > > > > > > > > > > > > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-07 Thread Richard Biener
On Mon, 5 Aug 2019, Uros Bizjak wrote: > On Mon, Aug 5, 2019 at 3:29 PM Richard Biener wrote: > > > > > > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI > > > > > > > > "TARGET_AVX512F"]) > > > > > > > > > > > > > > > > and then we need to split DImode for 32bits, too. > > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Uros Bizjak
On Mon, Aug 5, 2019 at 3:29 PM Richard Biener wrote: > > > > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI > > > > > > > "TARGET_AVX512F"]) > > > > > > > > > > > > > > and then we need to split DImode for 32bits, too. > > > > > > > > > > > > For now, please add "TARGET_64BIT

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Richard Biener
On Mon, 5 Aug 2019, Uros Bizjak wrote: > On Mon, Aug 5, 2019 at 3:04 PM Richard Biener wrote: > > > > On Mon, 5 Aug 2019, Uros Bizjak wrote: > > > > > On Mon, Aug 5, 2019 at 2:54 PM Jakub Jelinek wrote: > > > > > > > > On Mon, Aug 05, 2019 at 02:51:01PM +0200, Uros Bizjak wrote: > > > > > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Uros Bizjak
On Mon, Aug 5, 2019 at 3:04 PM Richard Biener wrote: > > On Mon, 5 Aug 2019, Uros Bizjak wrote: > > > On Mon, Aug 5, 2019 at 2:54 PM Jakub Jelinek wrote: > > > > > > On Mon, Aug 05, 2019 at 02:51:01PM +0200, Uros Bizjak wrote: > > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Richard Biener
On Mon, 5 Aug 2019, Uros Bizjak wrote: > On Mon, Aug 5, 2019 at 2:54 PM Jakub Jelinek wrote: > > > > On Mon, Aug 05, 2019 at 02:51:01PM +0200, Uros Bizjak wrote: > > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI > > > > "TARGET_AVX512F"]) > > > > > > > > and then we need to

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Uros Bizjak
On Mon, Aug 5, 2019 at 2:54 PM Jakub Jelinek wrote: > > On Mon, Aug 05, 2019 at 02:51:01PM +0200, Uros Bizjak wrote: > > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI > > > "TARGET_AVX512F"]) > > > > > > and then we need to split DImode for 32bits, too. > > > > For now, please

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Jakub Jelinek
On Mon, Aug 05, 2019 at 02:51:01PM +0200, Uros Bizjak wrote: > > (define_mode_iterator MAXMIN_IMODE [SI "TARGET_SSE4_1"] [DI > > "TARGET_AVX512F"]) > > > > and then we need to split DImode for 32bits, too. > > For now, please add "TARGET_64BIT && TARGET_AVX512F" for DImode > condition, I'll

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Uros Bizjak
On Mon, Aug 5, 2019 at 2:43 PM Uros Bizjak wrote: > > On Mon, Aug 5, 2019 at 1:50 PM Richard Biener wrote: > > > > On Sun, 4 Aug 2019, Uros Bizjak wrote: > > > > > On Sat, Aug 3, 2019 at 7:26 PM Richard Biener wrote: > > > > > > > > On Thu, 1 Aug 2019, Uros Bizjak wrote: > > > > > > > > > On

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Uros Bizjak
On Mon, Aug 5, 2019 at 1:50 PM Richard Biener wrote: > > On Sun, 4 Aug 2019, Uros Bizjak wrote: > > > On Sat, Aug 3, 2019 at 7:26 PM Richard Biener wrote: > > > > > > On Thu, 1 Aug 2019, Uros Bizjak wrote: > > > > > > > On Thu, Aug 1, 2019 at 11:28 AM Richard Biener > > > > wrote: > > > > > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Uros Bizjak
On Mon, Aug 5, 2019 at 1:50 PM Richard Biener wrote: > > On Sun, 4 Aug 2019, Uros Bizjak wrote: > > > On Sat, Aug 3, 2019 at 7:26 PM Richard Biener wrote: > > > > > > On Thu, 1 Aug 2019, Uros Bizjak wrote: > > > > > > > On Thu, Aug 1, 2019 at 11:28 AM Richard Biener > > > > wrote: > > > > > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Uros Bizjak
On Mon, Aug 5, 2019 at 2:16 PM Richard Biener wrote: > > On Mon, 5 Aug 2019, Uros Bizjak wrote: > > > > dimode_{scalar_to_vector_candidate_p,remove_non_convertible_regs} > > > functions to drop the dimode_ prefix - is that OK or do you > > > prefer some other prefix? > > > > No, please just drop

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Richard Biener
On Mon, 5 Aug 2019, Uros Bizjak wrote: > > dimode_{scalar_to_vector_candidate_p,remove_non_convertible_regs} > > functions to drop the dimode_ prefix - is that OK or do you > > prefer some other prefix? > > No, please just drop the prefix. just noticed this applies to the derived

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Uros Bizjak
On Mon, Aug 5, 2019 at 1:50 PM Richard Biener wrote: > > On Sun, 4 Aug 2019, Uros Bizjak wrote: > > > On Sat, Aug 3, 2019 at 7:26 PM Richard Biener wrote: > > > > > > On Thu, 1 Aug 2019, Uros Bizjak wrote: > > > > > > > On Thu, Aug 1, 2019 at 11:28 AM Richard Biener > > > > wrote: > > > > > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Richard Biener
On Sun, 4 Aug 2019, Uros Bizjak wrote: > On Sat, Aug 3, 2019 at 7:26 PM Richard Biener wrote: > > > > On Thu, 1 Aug 2019, Uros Bizjak wrote: > > > > > On Thu, Aug 1, 2019 at 11:28 AM Richard Biener wrote: > > > > > So you unconditionally add a smaxdi3 pattern - indeed this looks > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Richard Sandiford
Uros Bizjak writes: > On Mon, Aug 5, 2019 at 12:12 PM Richard Sandiford > wrote: >> >> Uros Bizjak writes: >> > On Mon, Aug 5, 2019 at 11:13 AM Richard Sandiford >> > wrote: >> >> >> >> Uros Bizjak writes: >> >> > On Sat, Aug 3, 2019 at 7:26 PM Richard Biener wrote: >> >> >> >> >> >> On Thu,

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Uros Bizjak
On Mon, Aug 5, 2019 at 12:12 PM Richard Sandiford wrote: > > Uros Bizjak writes: > > On Mon, Aug 5, 2019 at 11:13 AM Richard Sandiford > > wrote: > >> > >> Uros Bizjak writes: > >> > On Sat, Aug 3, 2019 at 7:26 PM Richard Biener wrote: > >> >> > >> >> On Thu, 1 Aug 2019, Uros Bizjak wrote: >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Richard Sandiford
Uros Bizjak writes: > On Mon, Aug 5, 2019 at 11:13 AM Richard Sandiford > wrote: >> >> Uros Bizjak writes: >> > On Sat, Aug 3, 2019 at 7:26 PM Richard Biener wrote: >> >> >> >> On Thu, 1 Aug 2019, Uros Bizjak wrote: >> >> >> >> > On Thu, Aug 1, 2019 at 11:28 AM Richard Biener >> >> > wrote:

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Uros Bizjak
On Mon, Aug 5, 2019 at 11:13 AM Richard Sandiford wrote: > > Uros Bizjak writes: > > On Sat, Aug 3, 2019 at 7:26 PM Richard Biener wrote: > >> > >> On Thu, 1 Aug 2019, Uros Bizjak wrote: > >> > >> > On Thu, Aug 1, 2019 at 11:28 AM Richard Biener wrote: > >> > > >> So you unconditionally

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Richard Sandiford
Uros Bizjak writes: > On Sat, Aug 3, 2019 at 7:26 PM Richard Biener wrote: >> >> On Thu, 1 Aug 2019, Uros Bizjak wrote: >> >> > On Thu, Aug 1, 2019 at 11:28 AM Richard Biener wrote: >> > >> So you unconditionally add a smaxdi3 pattern - indeed this looks >> necessary even when going

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-05 Thread Richard Biener
On Sun, 4 Aug 2019, Uros Bizjak wrote: > On Sun, Aug 4, 2019 at 7:23 PM Jakub Jelinek wrote: > > > > On Sun, Aug 04, 2019 at 07:11:01PM +0200, Uros Bizjak wrote: > > > Yes, the approach looks OK to me. It makes chain building mode > > > agnostic, and the chain building can be used for > > > a)

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-04 Thread Uros Bizjak
On Sun, Aug 4, 2019 at 7:23 PM Jakub Jelinek wrote: > > On Sun, Aug 04, 2019 at 07:11:01PM +0200, Uros Bizjak wrote: > > Yes, the approach looks OK to me. It makes chain building mode > > agnostic, and the chain building can be used for > > a) DImode x86_32 (as is now), but maybe 64bit minmax

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-04 Thread Jakub Jelinek
On Sun, Aug 04, 2019 at 07:11:01PM +0200, Uros Bizjak wrote: > Yes, the approach looks OK to me. It makes chain building mode > agnostic, and the chain building can be used for > a) DImode x86_32 (as is now), but maybe 64bit minmax operation can be added. > b) SImode x86_32 and x86_64 (this will

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-04 Thread Uros Bizjak
On Sat, Aug 3, 2019 at 7:26 PM Richard Biener wrote: > > On Thu, 1 Aug 2019, Uros Bizjak wrote: > > > On Thu, Aug 1, 2019 at 11:28 AM Richard Biener wrote: > > > So you unconditionally add a smaxdi3 pattern - indeed this looks > necessary even when going the STV route. The actual

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-03 Thread Richard Biener
On Thu, 1 Aug 2019, Uros Bizjak wrote: On Thu, Aug 1, 2019 at 11:28 AM Richard Biener wrote: So you unconditionally add a smaxdi3 pattern - indeed this looks necessary even when going the STV route. The actual regression for the testcase could also be solved by turing the smaxsi3 back into

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-01 Thread Uros Bizjak
On Thu, Aug 1, 2019 at 11:28 AM Richard Biener wrote: > > > So you unconditionally add a smaxdi3 pattern - indeed this looks > > > necessary even when going the STV route. The actual regression > > > for the testcase could also be solved by turing the smaxsi3 > > > back into a compare and jump

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-01 Thread Richard Biener
On Thu, 1 Aug 2019, Uros Bizjak wrote: > On Wed, Jul 31, 2019 at 1:21 PM Richard Biener wrote: > > > > On Sat, 27 Jul 2019, Uros Bizjak wrote: > > > > > On Sat, Jul 27, 2019 at 12:07 PM Uros Bizjak wrote: > > > > > > > > How would one write smaxsi3 as a splitter to be split after > > > > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-08-01 Thread Uros Bizjak
On Wed, Jul 31, 2019 at 1:21 PM Richard Biener wrote: > > On Sat, 27 Jul 2019, Uros Bizjak wrote: > > > On Sat, Jul 27, 2019 at 12:07 PM Uros Bizjak wrote: > > > > > > How would one write smaxsi3 as a splitter to be split after > > > > reload in the case LRA assigned the GPR alternative? Is it

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-07-31 Thread Richard Biener
On Sat, 27 Jul 2019, Uros Bizjak wrote: > On Sat, Jul 27, 2019 at 12:07 PM Uros Bizjak wrote: > > > > How would one write smaxsi3 as a splitter to be split after > > > reload in the case LRA assigned the GPR alternative? Is it > > > even worth doing? Even the SSE reg alternative can be split

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-07-27 Thread Uros Bizjak
On Sat, Jul 27, 2019 at 12:07 PM Uros Bizjak wrote: > > How would one write smaxsi3 as a splitter to be split after > > reload in the case LRA assigned the GPR alternative? Is it > > even worth doing? Even the SSE reg alternative can be split > > to remove the not needed CC clobber. > > > >

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-07-27 Thread Uros Bizjak
On Thu, Jul 25, 2019 at 2:21 PM Richard Biener wrote: > > On Thu, 25 Jul 2019, Martin Jambor wrote: > > > Hello, > > > > On Tue, Jul 23 2019, Richard Biener wrote: > > > The following fixes the runtime regression of 456.hmmer caused > > > by matching ICC in code generation and using cmov more

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-07-27 Thread Uros Bizjak
On Wed, Jul 24, 2019 at 5:03 PM Jeff Law wrote: > > Clearly this approach will run into register allocation issues > > but it looks cleaner than writing yet another STV-like pass > > (STV itself is quite awkwardly structured so I refrain from > > touching it...). > > > > Anyway - comments? It

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-07-25 Thread Richard Biener
On Thu, 25 Jul 2019, Martin Jambor wrote: > Hello, > > On Tue, Jul 23 2019, Richard Biener wrote: > > The following fixes the runtime regression of 456.hmmer caused > > by matching ICC in code generation and using cmov more aggressively > > (through GIMPLE level MAX_EXPR usage). Appearantly

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-07-25 Thread Martin Jambor
Hello, On Tue, Jul 23 2019, Richard Biener wrote: > The following fixes the runtime regression of 456.hmmer caused > by matching ICC in code generation and using cmov more aggressively > (through GIMPLE level MAX_EXPR usage). Appearantly (discovered > by manual assembler editing) using the SSE

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-07-24 Thread Jeff Law
On 7/23/19 8:00 AM, Richard Biener wrote: > > The following fixes the runtime regression of 456.hmmer caused > by matching ICC in code generation and using cmov more aggressively > (through GIMPLE level MAX_EXPR usage). Appearantly (discovered > by manual assembler editing) using the SSE unit

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-07-24 Thread Richard Biener
On Wed, 24 Jul 2019, Richard Biener wrote: > On Tue, 23 Jul 2019, Richard Biener wrote: > > > > > The following fixes the runtime regression of 456.hmmer caused > > by matching ICC in code generation and using cmov more aggressively > > (through GIMPLE level MAX_EXPR usage). Appearantly

Re: [PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-07-24 Thread Richard Biener
On Tue, 23 Jul 2019, Richard Biener wrote: > > The following fixes the runtime regression of 456.hmmer caused > by matching ICC in code generation and using cmov more aggressively > (through GIMPLE level MAX_EXPR usage). Appearantly (discovered > by manual assembler editing) using the SSE unit

[PATCH][RFC][x86] Fix PR91154, add SImode smax, allow SImode add in SSE regs

2019-07-23 Thread Richard Biener
The following fixes the runtime regression of 456.hmmer caused by matching ICC in code generation and using cmov more aggressively (through GIMPLE level MAX_EXPR usage). Appearantly (discovered by manual assembler editing) using the SSE unit for performing SImode loads, adds and then two singed