From: Michael Meissner <meissner@linux.vnet.ibm.com>
To: Segher Boessenkool <segher@kernel.crashing.org>
Cc: Michael Meissner <meissner@linux.vnet.ibm.com>,
GCC Patches <gcc-patches@gcc.gnu.org>,
David Edelsohn <dje.gcc@gmail.com>,
Bill Schmidt <wschmidt@linux.vnet.ibm.com>
Subject: Re: [PATCH, rev 2] PR target/79799, Add vec_insert of V4SFmode on PowerPC ISA 3.0 (power9)
Date: Fri, 16 Jun 2017 20:27:00 -0000 [thread overview]
Message-ID: <20170616202658.GA2150@ibm-tiger.the-meissners.org> (raw)
In-Reply-To: <20170616195246.GH16550@gate.crashing.org>
On Fri, Jun 16, 2017 at 02:52:46PM -0500, Segher Boessenkool wrote:
> Hi Mike,
>
> On Thu, Jun 15, 2017 at 10:10:28PM -0400, Michael Meissner wrote:
> > +(define_insn_and_split "vsx_set_v4sf_p9"
> > + [(set (match_operand:V4SF 0 "gpc_reg_operand" "=wa")
> > + (unspec:V4SF
> > + [(match_operand:V4SF 1 "gpc_reg_operand" "0")
> > + (match_operand:SF 2 "gpc_reg_operand" "ww")
> > + (match_operand:QI 3 "const_0_to_3_operand" "n")]
> > + UNSPEC_VSX_SET))
> > + (clobber (match_scratch:SI 4 "=&wJwK"))]
> > + "VECTOR_MEM_VSX_P (V4SFmode) && TARGET_P9_VECTOR"
> > + "#"
> > + "&& reload_completed"
>
> I still don't think it is such a good idea to do all of this not until
> after reload. It does of course allow you to play tricks with changing
> register mode at will, like you do ;-)
The problem is MODES_TIEABLE_P. V4S{I,F}mode and SImode cannot be tied
together (i.e. use gen_lowpart to change the mode and use a SUBREG). So after
reload, we can just use gen_rtx_REG (...) to change the register type, but
before reload, by creating the SUBREG, it can lead to various aborts if rtl
checking is turned on.
> All these unspecs are a similar problem: the RTL optimisers cannot do
> much at all with it.
I don't think there is a good way to represent a vec_insert. And vec_extract
can't represent a variable extract either.
> > + [(set_attr "type" "vecperm")
I generally use the type of the last insn. I am open to other suggestions.
> Is that a good type for this? I think the convert is more expensive
> than the permutes? If so, that would be better (of course it only
> matters for sched1, not super important).
>
> > --- gcc/testsuite/gcc.target/powerpc/pr79799-1.c (nonexistent)
> > +++ gcc/testsuite/gcc.target/powerpc/pr79799-1.c (working copy)
> > @@ -0,0 +1,43 @@
> > +/* { dg-do compile { target { powerpc64*-*-* && lp64 } } } */
>
> Why not powerpc*-*-*?
Well as it turns out, it aborts in 32-bit, because -mvsx-small-integer is not
enabled, and we can't have SImode in vector registers. I'll have to add some
additional tests and resubmit the patch.
>
> > +/* { dg-skip-if "do not override -mcpu" { powerpc*-*-* } { "-mcpu=*" } { "-mcpu=power9" } } */
> > +/* { dg-require-effective-target powerpc_p9vector_ok } */
> > +/* { dg-options "-mcpu=power9 -O2" } */
> > +
> > +#include <altivec.h>
> > +
> > +/* GCC 7.1 did not have a specialized method for inserting 32-bit floating point on
> > + ISA 3.0 (power9) systems. */
>
> That first line is a bit long.
Ok.
> The patch is okay for trunk and 7 with the testsuite nits taken care of.
--
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
next prev parent reply other threads:[~2017-06-16 20:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-15 0:02 [PATCH] " Michael Meissner
2017-06-15 23:39 ` Michael Meissner
2017-06-16 2:10 ` [PATCH, rev 2] " Michael Meissner
2017-06-16 19:52 ` Segher Boessenkool
2017-06-16 20:27 ` Michael Meissner [this message]
2017-06-16 21:30 ` Segher Boessenkool
2017-06-16 21:55 ` Michael Meissner
2017-06-19 23:16 ` Segher Boessenkool
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170616202658.GA2150@ibm-tiger.the-meissners.org \
--to=meissner@linux.vnet.ibm.com \
--cc=dje.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=segher@kernel.crashing.org \
--cc=wschmidt@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).