Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-25 Thread Uros Bizjak
On Mon, Apr 25, 2016 at 9:45 PM, Richard Sandiford wrote: >>> Can you please investigate, what is wrong with all_ones_operand so it >>> doesn't accept all (-1) operands? >> >> Does following work: >> >> ;; Return true if operand is a (vector) constant with all bits set. >> (define_predicate "all_

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-25 Thread Richard Sandiford
Uros Bizjak writes: > On Fri, Apr 22, 2016 at 7:10 PM, Uros Bizjak wrote: >> On Fri, Apr 22, 2016 at 4:19 PM, H.J. Lu wrote: >>> On Fri, Apr 22, 2016 at 5:11 AM, Uros Bizjak wrote: On Thu, Apr 21, 2016 at 10:58 PM, H.J. Lu wrote: > Here is the updated patch with my standard_sse_c

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-24 Thread Uros Bizjak
Hello! Attached patch is what I have committed to handle immediates with all bits set as standard SSE constants. 2016-04-24 Uros Bizjak H.J. Lu * config/i386/i386-protos.h (standard_sse_constant_p): Add machine_mode argument. * config/i386/i386.c (standard_sse_constant_p

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-22 Thread H.J. Lu
case modeless (-1) is passed. Please > note that VOID mode with modeless (-1) will ICE by design, since > standard_sse_constant_p is not able to determine if insn is supported > by target ISA. > This works: /* Return 1 if X is all bits 0 and 2 if X is all bits 1 in supported SSE/A

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-22 Thread Uros Bizjak
On Fri, Apr 22, 2016 at 8:20 PM, H.J. Lu wrote: > On Fri, Apr 22, 2016 at 10:29 AM, Uros Bizjak wrote: >> On Fri, Apr 22, 2016 at 7:10 PM, Uros Bizjak wrote: >>> On Fri, Apr 22, 2016 at 4:19 PM, H.J. Lu wrote: On Fri, Apr 22, 2016 at 5:11 AM, Uros Bizjak wrote: > On Thu, Apr 21, 2016

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-22 Thread H.J. Lu
On Fri, Apr 22, 2016 at 10:29 AM, Uros Bizjak wrote: > On Fri, Apr 22, 2016 at 7:10 PM, Uros Bizjak wrote: >> On Fri, Apr 22, 2016 at 4:19 PM, H.J. Lu wrote: >>> On Fri, Apr 22, 2016 at 5:11 AM, Uros Bizjak wrote: On Thu, Apr 21, 2016 at 10:58 PM, H.J. Lu wrote: > Here is the upd

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-22 Thread Uros Bizjak
On Fri, Apr 22, 2016 at 7:10 PM, Uros Bizjak wrote: > On Fri, Apr 22, 2016 at 4:19 PM, H.J. Lu wrote: >> On Fri, Apr 22, 2016 at 5:11 AM, Uros Bizjak wrote: >>> On Thu, Apr 21, 2016 at 10:58 PM, H.J. Lu wrote: >>> Here is the updated patch with my standard_sse_constant_p change and yo

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-22 Thread Uros Bizjak
On Fri, Apr 22, 2016 at 4:19 PM, H.J. Lu wrote: > On Fri, Apr 22, 2016 at 5:11 AM, Uros Bizjak wrote: >> On Thu, Apr 21, 2016 at 10:58 PM, H.J. Lu wrote: >> >>> Here is the updated patch with my standard_sse_constant_p change and >>> your SSE/AVX pattern change. I didn't include your >>> standa

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-22 Thread H.J. Lu
F. > + */ > + if ((HOST_WIDE_INT) INTVAL (x) == HOST_WIDE_INT_M1 > + && (mode == VOIDmode > + || (mode == TImode && TARGET_SSE2) > + || (mode == OImode && TARGET_AVX2) > + || (mode == XImode && TARGET_AVX512F))) > + return

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-22 Thread H.J. Lu
On Fri, Apr 22, 2016 at 7:19 AM, H.J. Lu wrote: > On Fri, Apr 22, 2016 at 5:11 AM, Uros Bizjak wrote: >> On Thu, Apr 21, 2016 at 10:58 PM, H.J. Lu wrote: >> >>> Here is the updated patch with my standard_sse_constant_p change and >>> your SSE/AVX pattern change. I didn't include your >>> standa

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-22 Thread H.J. Lu
On Fri, Apr 22, 2016 at 5:11 AM, Uros Bizjak wrote: > On Thu, Apr 21, 2016 at 10:58 PM, H.J. Lu wrote: > >> Here is the updated patch with my standard_sse_constant_p change and >> your SSE/AVX pattern change. I didn't include your >> standard_sse_constant_opcode since it didn't compile nor is ne

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-22 Thread Uros Bizjak
On Thu, Apr 21, 2016 at 10:58 PM, H.J. Lu wrote: > Here is the updated patch with my standard_sse_constant_p change and > your SSE/AVX pattern change. I didn't include your > standard_sse_constant_opcode since it didn't compile nor is needed > for this purpose. H.J., please test the attached p

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread H.J. Lu
mp; general_operand (dest, GET_MODE (dest)) >>> postreload-gcse.c: && general_operand (src, GET_MODE (src)) >>> >>> IRA and LRA use GET_MODE and pass it to predicates. >> >> I don't know what are you trying to prove here ... > > The "mode" argument passed

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread H.J. Lu
On Thu, Apr 21, 2016 at 9:31 AM, Uros Bizjak wrote: > On Thu, Apr 21, 2016 at 4:50 PM, H.J. Lu wrote: > I tried and it doesn't work since the correct mode may not be always available in predicates. Yes, they pass mode. But they just do mode = GET_MODE (op); which r

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread Uros Bizjak
On Thu, Apr 21, 2016 at 4:50 PM, H.J. Lu wrote: >>> I tried and it doesn't work since the correct mode may not be always >>> available in predicates. Yes, they pass mode. But they just do >>> >>> mode = GET_MODE (op); >>> >>> which returns VOIDmode for -1. >> >> Well, looking at generated gcc/i

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread H.J. Lu
On Thu, Apr 21, 2016 at 6:59 AM, Uros Bizjak wrote: > On Thu, Apr 21, 2016 at 3:54 PM, H.J. Lu wrote: >> On Thu, Apr 21, 2016 at 6:48 AM, Uros Bizjak wrote: >>> On Thu, Apr 21, 2016 at 3:43 PM, H.J. Lu wrote: On Thu, Apr 21, 2016 at 6:33 AM, Uros Bizjak wrote: > On Thu, Apr 21, 2016 a

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread Uros Bizjak
On Thu, Apr 21, 2016 at 3:54 PM, H.J. Lu wrote: > On Thu, Apr 21, 2016 at 6:48 AM, Uros Bizjak wrote: >> On Thu, Apr 21, 2016 at 3:43 PM, H.J. Lu wrote: >>> On Thu, Apr 21, 2016 at 6:33 AM, Uros Bizjak wrote: On Thu, Apr 21, 2016 at 2:59 PM, H.J. Lu wrote: >> We know, that const_

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread H.J. Lu
On Thu, Apr 21, 2016 at 6:48 AM, Uros Bizjak wrote: > On Thu, Apr 21, 2016 at 3:43 PM, H.J. Lu wrote: >> On Thu, Apr 21, 2016 at 6:33 AM, Uros Bizjak wrote: >>> On Thu, Apr 21, 2016 at 2:59 PM, H.J. Lu wrote: >>> > We know, that const_int (-1) is allowed with TARGET_SSE2 and that > cons

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread Uros Bizjak
On Thu, Apr 21, 2016 at 3:43 PM, H.J. Lu wrote: > On Thu, Apr 21, 2016 at 6:33 AM, Uros Bizjak wrote: >> On Thu, Apr 21, 2016 at 2:59 PM, H.J. Lu wrote: >> We know, that const_int (-1) is allowed with TARGET_SSE2 and that const_wide_int (-1) is allowed with TARGET_AVX2. Probably we don

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread H.J. Lu
On Thu, Apr 21, 2016 at 6:33 AM, Uros Bizjak wrote: > On Thu, Apr 21, 2016 at 2:59 PM, H.J. Lu wrote: > >>> We know, that const_int (-1) is allowed with TARGET_SSE2 and that >>> const_wide_int (-1) is allowed with TARGET_AVX2. Probably we don't >>> have to check AVX512F in standard_sse_constant_p

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread Uros Bizjak
On Thu, Apr 21, 2016 at 2:59 PM, H.J. Lu wrote: >> We know, that const_int (-1) is allowed with TARGET_SSE2 and that >> const_wide_int (-1) is allowed with TARGET_AVX2. Probably we don't >> have to check AVX512F in standard_sse_constant_p, as it implies >> TARGET_AVX2. >> >> As said, it is the jo

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread H.J. Lu
On Thu, Apr 21, 2016 at 5:15 AM, Uros Bizjak wrote: > On Thu, Apr 21, 2016 at 1:54 PM, H.J. Lu wrote: >> On Thu, Apr 21, 2016 at 3:18 AM, Uros Bizjak wrote: >>> On Thu, Apr 21, 2016 at 9:42 AM, Uros Bizjak wrote: On Thu, Apr 21, 2016 at 9:37 AM, Uros Bizjak wrote: > On Wed, Apr 20, 20

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread Uros Bizjak
On Thu, Apr 21, 2016 at 1:54 PM, H.J. Lu wrote: > On Thu, Apr 21, 2016 at 3:18 AM, Uros Bizjak wrote: >> On Thu, Apr 21, 2016 at 9:42 AM, Uros Bizjak wrote: >>> On Thu, Apr 21, 2016 at 9:37 AM, Uros Bizjak wrote: On Wed, Apr 20, 2016 at 9:53 PM, H.J. Lu wrote: > Since all 1s in TImode

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread H.J. Lu
On Thu, Apr 21, 2016 at 3:18 AM, Uros Bizjak wrote: > On Thu, Apr 21, 2016 at 9:42 AM, Uros Bizjak wrote: >> On Thu, Apr 21, 2016 at 9:37 AM, Uros Bizjak wrote: >>> On Wed, Apr 20, 2016 at 9:53 PM, H.J. Lu wrote: Since all 1s in TImode is standard SSE2 constants, all 1s in OImode is s

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread Uros Bizjak
On Thu, Apr 21, 2016 at 9:42 AM, Uros Bizjak wrote: > On Thu, Apr 21, 2016 at 9:37 AM, Uros Bizjak wrote: >> On Wed, Apr 20, 2016 at 9:53 PM, H.J. Lu wrote: >>> Since all 1s in TImode is standard SSE2 constants, all 1s in OImode is >>> standard AVX2 constants and all 1s in XImode is standard AVX

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread Uros Bizjak
On Thu, Apr 21, 2016 at 9:37 AM, Uros Bizjak wrote: > On Wed, Apr 20, 2016 at 9:53 PM, H.J. Lu wrote: >> Since all 1s in TImode is standard SSE2 constants, all 1s in OImode is >> standard AVX2 constants and all 1s in XImode is standard AVX512F constants, >> pass mode to standard_sse_constant_p an

Re: [PATCH] Allow all 1s of integer as standard SSE constants

2016-04-21 Thread Uros Bizjak
On Wed, Apr 20, 2016 at 9:53 PM, H.J. Lu wrote: > Since all 1s in TImode is standard SSE2 constants, all 1s in OImode is > standard AVX2 constants and all 1s in XImode is standard AVX512F constants, > pass mode to standard_sse_constant_p and standard_sse_constant_opcode > to check if all 1s is ava

[PATCH] Allow all 1s of integer as standard SSE constants

2016-04-20 Thread H.J. Lu
Since all 1s in TImode is standard SSE2 constants, all 1s in OImode is standard AVX2 constants and all 1s in XImode is standard AVX512F constants, pass mode to standard_sse_constant_p and standard_sse_constant_opcode to check if all 1s is available for target. Tested on Linux/x86-64. OK for maste