public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marc Glisse <marc.glisse@inria.fr>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: gcc-patches@gcc.gnu.org, "H.J. Lu" <hjl.tools@gmail.com>
Subject: Re: [i386] scalar ops that preserve the high part of a vector
Date: Mon, 03 Dec 2012 15:34:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.02.1212030958050.3737@laptop-mg.saclay.inria.fr> (raw)
In-Reply-To: <CAFULd4Z4Ywk+BQupB+=tDKiWx5QrCt9VL83XF4Xtgu03=y0VZw@mail.gmail.com>

On Mon, 3 Dec 2012, Uros Bizjak wrote:

> On Sun, Dec 2, 2012 at 1:30 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
>
>>>> here is a patch. If it is accepted, I'll extend it to other vm patterns
>>>> (mul, div, min, max are likely candidates, but I need to check the doc).
>>>> It
>>>> passed bootstrap+testsuite on x86_64-linux.
>>>>
>>>>
>>>> 2012-12-01  Marc Glisse  <marc.glisse@inria.fr>
>>>>
>>>>         PR target/54855
>>>> gcc/
>>>>         * config/i386/sse.md (<sse>_vm<plusminus_insn><mode>3): Rewrite
>>>>         pattern.
>>>>         * config/i386/i386-builtin-types.def: New function types.
>>>>         * config/i386/i386.c (ix86_expand_args_builtin): Likewise.
>>>>         (bdesc_args) <__builtin_ia32_addss, __builtin_ia32_subss,
>>>>         __builtin_ia32_addsd, __builtin_ia32_subsd>: Change prototype.
>>>>         * config/i386/xmmintrin.h: Adapt to new builtin prototype.
>>>>         * config/i386/emmintrin.h: Likewise.
>>>>         * doc/extend.texi (X86 Built-in Functions): Document changed
>>>> prototype.
>>>>
>>>> testsuite/
>>>>         * gcc.target/i386/pr54855-1.c: New testcase.
>>>>         * gcc.target/i386/pr54855-2.c: New testcase.
>>>
>>>
>>> Yes, the approach looks correct to me, but I wonder why we have
>>> different representations for v4sf and v2df cases? I'd say that we
>>> should canonicalize patterns somewhere in the middle end (probably to
>>> vec_merge variant, as IMO vec_dup looks like degenerated vec_merge
>>> variant), otherwise we will have pattern explosion.
>>
>>
>> (I assume s/vec_dup/vec_concat/ above)
>
> Ah, yes.
>
> However, looking a bit more into the usage cases for these patterns,
> they are only used through intrinsics with _m128 operands. While your
> proposed patch makes these patterns more general (they can use 64bit
> aligned memory), this is not their usual usage, and for their intended
> usage, your proposed improvement complicates these patterns
> unnecessarily. Following on these facts, I'd say that we leave these
> special patters (since they serve their purpose well) and rather
> introduce new patterns for "other" uses.

You mean like in the original patch?
http://gcc.gnu.org/ml/gcc-patches/2012-10/msg01279.html

(it only had the V2DF version, not the V4SF one)

Funny how we switched sides, now I am the one who would rather have a 
single pattern instead of having one for the builtin and one for recog. It 
seems that once we add the new pattern, keeping the old one is a waste of 
maintenance time, and the few extra rtx from the slightly longer pattern 
for these seldomly used builtins should be negligible.

But I don't mind, if that's the version you prefer, I'll update the patch.

Thanks,

-- 
Marc Glisse

  reply	other threads:[~2012-12-03 15:34 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 [this message]
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
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.1212030958050.3737@laptop-mg.saclay.inria.fr \
    --to=marc.glisse@inria.fr \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.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).