public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marc Glisse <marc.glisse@inria.fr>
To: Michael Zolotukhin <michael.v.zolotukhin@gmail.com>
Cc: Kirill Yukhin <kirill.yukhin@gmail.com>,
	"H.J. Lu" <hjl.tools@gmail.com>,
	    Uros Bizjak <ubizjak@gmail.com>,
	    gcc-patches List <gcc-patches@gcc.gnu.org>,
	rth@redhat.com
Subject: Re: [i386] scalar ops that preserve the high part of a vector
Date: Fri, 07 Dec 2012 08:49:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.02.1212070934550.3800@laptop-mg.saclay.inria.fr> (raw)
In-Reply-To: <CANtU07-4ce+_wHenrbJCP879rnAsP+B+P6GGdqeZ8A0drA11cA@mail.gmail.com>

On Fri, 7 Dec 2012, Michael Zolotukhin wrote:

> 1) Does the root problem lay in the fact that even for scalar
> additions we perform the addition on the whole vector and only then
> drop the higher parts of the vector? I.e. to fix the test from the PR
> we need to replace plus on vector mode with plus on scalar mode?

The root problem is that we model the subs[sd] instructions as taking a 
128-bit second operand, when Intel's documentation says they take a 
32/64-bit operand, which is an important difference for memory operands 
(and constants). Writing a pattern that reconstructs the result from a 
scalar operation also seems more natural than pretending we are doing a 
parallel operation and dropping most of it (easier for recog and friends).

(note: I think the insn was written to support the intrinsic, which does 
take a 128-bit argument, so it did a good job for that)

> 2) Is one of the main requirements having the same pattern for V4SF
> and V2DF version?

Uros seems to think that would be best.

> 3) I don't see vec_concat in patterns from your patches, is it
> explicitly generated by some x86-expander?

It is generated by ix86_expand_vector_set.

> Anyway, I really like the idea of having some uniformity in describing
> patterns for scalar instructions, so thank you for the work!

For 2-element vectors, vec_concat does seem more natural than vec_merge. 
If we chose vec_merge as the canonical representation, we should chose it 
for setting an element in a vector (ix86_expand_vector_set) everywhere, 
not just those scalarish operations.

So it would be good to have rth's opinion on this (svn blame seems to 
indicate he is the one who chose to use vec_concat specifically for V2DF 
instead of vec_merge).

-- 
Marc Glisse

  parent reply	other threads:[~2012-12-07  8:49 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-13  9:33 Marc Glisse
2012-10-14  9:54 ` Uros Bizjak
2012-10-14 12:52   ` Marc Glisse
2012-11-30 12:36     ` Marc Glisse
2012-11-30 13:55       ` Uros Bizjak
2012-11-30 22:36         ` Marc Glisse
2012-12-01 17:27           ` Marc Glisse
2012-12-02 10:51             ` Uros Bizjak
2012-12-02 12:30               ` Marc Glisse
2012-12-03  8:53                 ` Uros Bizjak
2012-12-03 15:34                   ` Marc Glisse
2012-12-03 17:55                     ` Uros Bizjak
2012-12-04 14:05                       ` Marc Glisse
2012-12-04 16:28                         ` Marc Glisse
2012-12-04 18:06                           ` Uros Bizjak
2012-12-04 18:12                             ` H.J. Lu
2012-12-06 13:42                               ` Kirill Yukhin
2012-12-07  6:50                                 ` Michael Zolotukhin
2012-12-07  8:46                                   ` Uros Bizjak
2012-12-07  8:49                                   ` Marc Glisse [this message]
2012-12-07 10:52                                     ` Michael Zolotukhin
2012-12-07 14:02                                       ` Marc Glisse
2012-12-07 14:43                                     ` Richard Henderson
2012-12-07 14:47                                       ` Jakub Jelinek
2012-12-07 14:53                                         ` Richard Henderson
2012-12-07 15:00                                       ` Marc Glisse
2012-12-07 15:06                                         ` Richard Henderson
2012-12-07 15:12                                           ` Marc Glisse
2012-12-07 16:24                                             ` Richard Henderson
2012-12-07 17:23                                               ` Marc Glisse
2012-12-08  5:47                                                 ` Marc Glisse
2012-12-12 15:48                                                   ` Richard Henderson
2012-12-05 14:22                             ` Marc Glisse
2012-12-05 17:07                               ` Paolo Bonzini
2012-12-05 20:22                                 ` Marc Glisse
2012-12-05 21:05                               ` Eric Botcazou

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=alpine.DEB.2.02.1212070934550.3800@laptop-mg.saclay.inria.fr \
    --to=marc.glisse@inria.fr \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=kirill.yukhin@gmail.com \
    --cc=michael.v.zolotukhin@gmail.com \
    --cc=rth@redhat.com \
    --cc=ubizjak@gmail.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).