This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, rs6000 V3] Add Power 8 support to vec_revb
- From: Segher Boessenkool <segher at kernel dot crashing dot org>
- To: Carl Love <cel at us dot ibm dot com>
- Cc: gcc-patches at gcc dot gnu dot org, David Edelsohn <dje dot gcc at gmail dot com>, Bill Schmidt <wschmidt at linux dot vnet dot ibm dot com>
- Date: Wed, 1 Nov 2017 12:55:27 -0500
- Subject: Re: [PATCH, rs6000 V3] Add Power 8 support to vec_revb
- Authentication-results: sourceware.org; auth=none
- References: <1508772963.16660.28.camel@us.ibm.com> <20171026215656.GN4406@gate.crashing.org> <1509122944.9048.57.camel@us.ibm.com>
Hi Carl,
On Fri, Oct 27, 2017 at 09:49:04AM -0700, Carl Love wrote:
> > > +;; Swap all bytes in each element of vector
> > > +(define_expand "revb_<mode>"
> > > + [(set (match_operand:VEC_A 0 "vsx_register_operand")
> > > + (bswap:VEC_A (match_operand:VEC_A 1 "vsx_register_operand")))]
> > > + "TARGET_P9_VECTOR"
> > > +{
> > > + rtx sel;
> >
> > So a special case here:
> >
> > if (<MODE>mode == V16QImode)
> > {
> > emit_move_insn (operands[0], operands[1]);
> > DONE;
> > }
>
> Even if I put in the above special case, I still have issues with the
> <wd>. The updated code for the expand with the special case above is
[ snip ]
> The issue is the if (<MODE>mode == V16QImode) does not prevent the code
> in the else statement from getting expanded for <wd>. I agree it will
> prevent the generation of the instruction but the code is still expanded
> and compiled. I get the error message:
>
> /home/carll/GCC/gcc-revb/gcc/config/rs6000/vsx.md:4727:62: error:
> ‘gen_p9_xxbrb_v16qi’ was not declared in this scope
> emit_insn (gen_p9_xxbr<wd>_<mode> (operands[0], operands[1]));
>
> Because <wd> for mode v16qi still gets expanded to "b" not "q".
>
> There is no definition for "gen_p9_xxbrb_v16qi" since xxbrb is not
> vaild. Short of using a different expander for <wd> I don't see how to
> not get the expansion. Sorry if I am missing something obvious here.
I think you'll need another iterator, like VEC_A but without the V16QI
(possibly not the float modes either?)
Segher