This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RFC] VEC_SELECT sanity checking in genrecog
- From: Michael Meissner <meissner at linux dot vnet dot ibm dot com>
- To: Segher Boessenkool <segher at kernel dot crashing dot org>
- Cc: Jakub Jelinek <jakub at redhat dot com>, Eric Botcazou <ebotcazou at adacore dot com>, Richard Biener <rguenther at suse dot de>, Bernd Schmidt <bschmidt at redhat dot com>, Jeff Law <law at redhat dot com>, gcc-patches at gcc dot gnu dot org, meissner at linux dot vnet dot ibm dot com, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- Date: Fri, 3 Mar 2017 15:43:03 -0500
- Subject: Re: [RFC] VEC_SELECT sanity checking in genrecog
- Authentication-results: sourceware.org; auth=none
- References: <20170303162827.GD1849@tucnak> <20170303201957.GI31469@gate.crashing.org>
On Fri, Mar 03, 2017 at 02:19:57PM -0600, Segher Boessenkool wrote:
> Hi,
>
> On Fri, Mar 03, 2017 at 05:28:27PM +0100, Jakub Jelinek wrote:
> > E.g. in vsx.md the thing is that
> > the pattern uses an iterator with 2 V2?? modes in it and then V1TI mode,
> > and uses exactly two elements in paralle, which doesn't make any sense
> > for V1TI.
> >
> > ../../gcc/config/rs6000/vsx.md:2063:1: vec_select parallel with 2 elements, expected 1
> > ../../gcc/config/rs6000/vsx.md:2112:1: vec_select parallel with 2 elements, expected 1
> > ../../gcc/config/rs6000/vsx.md:2161:1: vec_select parallel with 2 elements, expected 1
>
> Yeah, it looks like these patterns should use VSX_D instead of VSX_LE.
> Mike, you know this code best, what do you think?
Bill Schmidt added these, but he is gone for the day.
No, these patterns need to use VSX_LE, but V1TI should be moved from VSX_LE to
VSX_LE_128. VSX_LE_128 is used for things like IEEE 128-bit floating point and
128-bit integers that can't use vec_select. In fact there is this comment:
;; Little endian word swapping for 128-bit types that are either scalars or the
;; special V1TI container class, which it is not appropriate to use vec_select
;; for the type.
(define_insn "*vsx_le_permute_<mode>"
[(set (match_operand:VSX_LE_128 0 "nonimmediate_operand" "=<VSa>,<VSa>,Z")
(rotate:VSX_LE_128
(match_operand:VSX_LE_128 1 "input_operand" "<VSa>,Z,<VSa>")
(const_int 64)))]
"!BYTES_BIG_ENDIAN && TARGET_VSX && !TARGET_P9_VECTOR"
"@
xxpermdi %x0,%x1,%x1,2
lxvd2x %x0,%y1
stxvd2x %x1,%y0"
[(set_attr "length" "4")
(set_attr "type" "vecperm,vecload,vecstore")])
--
Michael Meissner, IBM
IBM, M/S 2506R, 550 King Street, Littleton, MA 01460-6245, USA
email: meissner@linux.vnet.ibm.com, phone: +1 (978) 899-4797