public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "marc.glisse at normalesup dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/52607] v4df __builtin_shuffle with {0,2,1,3} or {1,3,0,2}
Date: Mon, 19 Mar 2012 19:00:00 -0000	[thread overview]
Message-ID: <bug-52607-4-fFR2sjCuOg@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-52607-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52607

--- Comment #9 from Marc Glisse <marc.glisse at normalesup dot org> 2012-03-19 18:29:50 UTC ---
(In reply to comment #8)
> I'm not very keen on having too many different routines, the more generic they
> are, the better.

Agreed, that was one of my concerns from the first message in this bug, but to
experiment it was easier to have separate functions.

> So IMHO e.g. the two insn sequence, vperm2[if]128 + some one
> insn shuffle could look like:
> 
> /* A subroutine of ix86_expand_vec_perm_builtin_1.  Try to expand
>    a vector permutation using two instructions, vperm2f128 resp.
>    vperm2i128 followed by any single in-lane permutation.  */

I haven't yet looked at it closely enough to understand what it does (those
functions are surprisingly confusing when you don't write them yourself), but
that looks interesting.

My first idea in order to make things more generic was to tentatively turn
__builtin_shuffle(x,m) into __builtin_shuffle(x,vperm2f128(x,x,33),mm) where mm
avoids any cross-lane. The 2-vector no-cross-lane shuffle should take at most 3
instructions in v4df or v8sf (I haven't checked if it works now) and that's
where most of the work would happen (instead of having many routines for
single-vector shuffles that almost all start with vperm2f128). Then you would
probably want to check how many instructions it used, since it could be more or
less than one of the few instruction sequences that don't start with
vperm2f128.

>From a quick look, it looks like you may be doing something even more
generic...

> This will handle e.g. vperm2f128 + {vshufpd,vblendpd,vunpcklpd,vunpckhpd} etc.

Cool!


  parent reply	other threads:[~2012-03-19 18:31 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-17  1:06 [Bug target/52607] New: " marc.glisse at normalesup dot org
2012-03-17  4:58 ` [Bug target/52607] " marc.glisse at normalesup dot org
2012-03-17 19:55 ` marc.glisse at normalesup dot org
2012-03-17 20:11 ` marc.glisse at normalesup dot org
2012-03-17 22:17 ` marc.glisse at normalesup dot org
2012-03-18 14:51 ` marc.glisse at normalesup dot org
2012-03-18 20:13 ` marc.glisse at normalesup dot org
2012-03-19 11:16 ` jakub at gcc dot gnu.org
2012-03-19 17:19 ` jakub at gcc dot gnu.org
2012-03-19 19:00 ` marc.glisse at normalesup dot org [this message]
2012-03-19 19:29 ` jakub at gcc dot gnu.org
2012-03-19 20:09 ` rth at gcc dot gnu.org
2012-03-20  9:26 ` jakub at gcc dot gnu.org
2012-03-20 16:27 ` jakub at gcc dot gnu.org
2012-03-20 16:56 ` jakub at gcc dot gnu.org
2012-03-20 19:05 ` marc.glisse at normalesup dot org
2012-03-20 19:09 ` marc.glisse at normalesup dot org
2012-03-20 22:03 ` marc.glisse at normalesup dot org
2012-03-25 14:09 ` marc.glisse at normalesup dot org
2012-03-27 16:59 ` jakub at gcc dot gnu.org
2012-03-27 17:25 ` jakub at gcc dot gnu.org
2012-03-27 18:23 ` marc.glisse at normalesup dot org
2012-03-27 21:21 ` marc.glisse at normalesup dot org
2012-03-29 13:41 ` rth at gcc dot gnu.org
2012-03-29 14:20 ` marc.glisse at normalesup dot org
2012-03-31  9:49 ` marc.glisse at normalesup dot org
2012-03-31 14:12 ` marc.glisse at normalesup dot org
2012-04-09 16:51 ` marc.glisse at normalesup dot org
2012-04-11 16:49 ` marc.glisse at normalesup dot org
2012-04-11 20:35 ` marc.glisse at normalesup dot org
2012-05-14 21:29 ` glisse at gcc dot gnu.org

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=bug-52607-4-fFR2sjCuOg@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /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).