public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: "gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH 36/40] i386: Allow MMX vector expanders with TARGET_MMX_WITH_SSE
Date: Tue, 12 Feb 2019 20:24:00 -0000	[thread overview]
Message-ID: <CAFULd4bK01HeviHh2c1HuJSbSdTxv=46smMTZoD8FhVcMNoJeg@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOrvGrKr6EioO0m_e2wNUtUM9AxrHuo5Z4Bu1ewK-sKCPA@mail.gmail.com>

On 2/12/19, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Tue, Feb 12, 2019 at 11:44 AM Uros Bizjak <ubizjak@gmail.com> wrote:
>>
>> On Tue, Feb 12, 2019 at 8:35 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>> >
>> > On Tue, Feb 12, 2019 at 5:43 AM Uros Bizjak <ubizjak@gmail.com> wrote:
>> > >
>> > > On Mon, Feb 11, 2019 at 11:55 PM H.J. Lu <hjl.tools@gmail.com> wrote:
>> > > >
>> > > >         PR target/89021
>> > > >         * config/i386/i386.c (ix86_expand_vector_init_duplicate):
>> > > > Set
>> > > >         mmx_ok to true if TARGET_MMX_WITH_SSE is true.
>> > > >         (ix86_expand_vector_init_one_nonzero): Likewise.
>> > > >         (ix86_expand_vector_init_one_var): Likewise.
>> > > >         (ix86_expand_vector_init_general): Likewise.
>> > > >         (ix86_expand_vector_init): Likewise.
>> > > >         (ix86_expand_vector_set): Likewise.
>> > > >         (ix86_expand_vector_extract): Likewise.
>> > > >         * config/i386/mmx.md (*vec_dupv2sf): Changed to
>> > > >         define_insn_and_split to support SSE emulation.
>> > > >         (vec_setv2sf): Also allow TARGET_MMX_WITH_SSE.
>> > > >         (vec_extractv2sf_1 splitter): Likewise.
>> > > >         (vec_extractv2sfsf): Likewise.
>> > > >         (vec_setv2si): Likewise.
>> > > >         (vec_extractv2si_1 splitter): Likewise.
>> > > >         (vec_extractv2sisi): Likewise.
>> > > >         (vec_setv4hi): Likewise.
>> > > >         (vec_extractv4hihi): Likewise.
>> > > >         (vec_setv8qi): Likewise.
>> > > >         (vec_extractv8qiqi): Likewise.
>> > > >         (*vec_extractv2sf_0): Don't allow TARGET_MMX_WITH_SSE.
>> > > >         (*vec_extractv2sf_1): Likewise.
>> > > >         (*vec_extractv2si_0): Likewise.
>> > > >         (*vec_extractv2si_1): Likewise.
>> > > >         (*vec_extractv2sf_0_sse): New.
>> > > >         (*vec_extractv2sf_1_sse): Likewise.
>> > > >         (*vec_extractv2si_0_sse): Likewise.
>> > > >         (*vec_extractv2si_1_sse): Likewise.
>> > >
>> > > Please do not introduce new *_sse patterns, use mmx_isa attribute to
>> > > disable unwanted alternatives.
>> >
>> > Will do.
>> >
>> > > >  (define_insn_and_split "*vec_extractv2si_zext_mem"
>> > > > -  [(set (match_operand:DI 0 "register_operand" "=y,x,r")
>> > > > +  [(set (match_operand:DI 0 "register_operand" "=x,r")
>> > > >         (zero_extend:DI
>> > > >           (vec_select:SI
>> > > > -           (match_operand:V2SI 1 "memory_operand" "o,o,o")
>> > > > +           (match_operand:V2SI 1 "memory_operand" "o,o")
>> > > >             (parallel [(match_operand:SI 2
>> > > > "const_0_to_1_operand")]))))]
>> > > > -  "TARGET_64BIT && TARGET_MMX"
>> > > > +  "TARGET_64BIT"
>> > >
>> > > Here you need TARGET_64BIT && (TARGET_MMX || TARGET_MMX_WITH_SSE) and
>> > > mmx_isa attribute.
>> > >
>> >
>> > Why is && (TARGET_MMX || TARGET_MMX_WITH_SSE) needed?  The 3rd
>> > alternative doesn't need MMX nor SSE2:
>>
>> Ah, I didn't notice that. LGTM then.
>>
>> > (define_insn_and_split "*vec_extractv2si_zext_mem"
>> >   [(set (match_operand:DI 0 "register_operand" "=y,x,r")
>> >         (zero_extend:DI
>> >           (vec_select:SI
>> >             (match_operand:V2SI 1 "memory_operand" "o,o,o")
>> >             (parallel [(match_operand:SI 2
>> > "const_0_to_1_operand")]))))]
>> >   "TARGET_64BIT"
>> >   "#"
>> >   "&& reload_completed"
>> >   [(set (match_dup 0) (zero_extend:DI (match_dup 1)))]
>> > {
>> >   operands[1] = adjust_address (operands[1], SImode, INTVAL
>> > (operands[2]) * 4);
>> > }
>> >   [(set_attr "mmx_isa" "native,sse2,base")])
>>
>> Please write this as "native,*,*".
>
> Did you mean "native,sse2,*"?  The second alternative is SSE2 MOVD:

No, my proposed definition is OK, see below.

> MOVD (when destination operand is XMM register)
> DEST[31:0] ← SRC;
> DEST[127:32] ← 000000000000000000000000H;
> DEST[MAXVL-1:128] (Unmodified)

You should also add "isa" attribute with "*,sse2,*", which should be
there from the beginning.

BTW: sse2 is not a member of mmx_isa. attribute.

Uros.

>> This way, it is clear that we enable alternative 0 only for native
>> mmx. It looks to me that we need to add similar treatment to a couple
>> of other patterns in sse.md, where we allow "y" constraint, e.g.
>> *vec_concatv2sf_sse, *vec_concatv2si_sse4_1, etc.
>>
>
> I will take a look.
>
> Thanks.
>
> --
> H.J.
>

  reply	other threads:[~2019-02-12 20:24 UTC|newest]

Thread overview: 70+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11 22:56 [PATCH 00/40] V4: Emulate MMX intrinsics with SSE H.J. Lu
2019-02-11 22:55 ` [PATCH 01/40] i386: Allow MMX register modes in SSE registers H.J. Lu
2019-02-11 22:56 ` [PATCH 04/40] i386: Emulate MMX plusminus/sat_plusminus with SSE H.J. Lu
2019-02-11 22:56 ` [PATCH 28/40] i386: Emulate MMX ssse3_ph<plusminus_mnemonic>dv2si3 " H.J. Lu
2019-02-12 11:21   ` Uros Bizjak
2019-02-11 22:56 ` [PATCH 09/40] i386: Emulate MMX <any_logic><mode>3 " H.J. Lu
2019-02-11 22:56 ` [PATCH 35/40] i386: Allow MMXMODE moves with TARGET_MMX_WITH_SSE H.J. Lu
2019-02-11 22:56 ` [PATCH 16/40] i386: Emulate MMX mmx_pextrw with SSE H.J. Lu
2019-02-11 22:56 ` [PATCH 24/40] i386: Emulate MMX mmx_psadbw " H.J. Lu
2019-02-11 22:56 ` [PATCH 11/40] i386: Emulate MMX mmx_eq/mmx_gt<mode>3 " H.J. Lu
2019-02-11 22:56 ` [PATCH 27/40] i386: Emulate MMX ssse3_ph<plusminus_mnemonic>wv4hi3 " H.J. Lu
2019-02-12 11:22   ` Uros Bizjak
2019-02-11 22:56 ` [PATCH 14/40] i386: Emulate MMX sse_cvtps2pi/sse_cvttps2pi " H.J. Lu
2019-02-11 22:56 ` [PATCH 02/40] i386: Emulate MMX packsswb/packssdw/packuswb with SSE2 H.J. Lu
2019-02-12 11:10   ` Uros Bizjak
2019-02-11 22:56 ` [PATCH 30/40] i386: Emulate MMX ssse3_pmulhrswv4hi3 with SSE H.J. Lu
2019-02-11 22:56 ` [PATCH 13/40] i386: Emulate MMX pshufw " H.J. Lu
2019-02-11 22:56 ` [PATCH 18/40] i386: Emulate MMX V4HI smaxmin/V8QI umaxmin " H.J. Lu
2019-02-11 22:56 ` [PATCH 21/40] i386: Emulate MMX maskmovq with SSE2 maskmovdqu H.J. Lu
2019-02-12 10:51   ` Uros Bizjak
2019-02-11 22:56 ` [PATCH 31/40] i386: Emulate MMX pshufb with SSE version H.J. Lu
2019-02-12 11:19   ` Uros Bizjak
2019-02-11 22:56 ` [PATCH 26/40] i386: Emulate MMX umulv1siv1di3 with SSE2 H.J. Lu
2019-02-11 22:56 ` [PATCH 29/40] i386: Emulate MMX ssse3_pmaddubsw with SSE H.J. Lu
2019-02-11 22:56 ` [PATCH 12/40] i386: Emulate MMX vec_dupv2si " H.J. Lu
2019-02-11 22:56 ` [PATCH 36/40] i386: Allow MMX vector expanders with TARGET_MMX_WITH_SSE H.J. Lu
2019-02-12 13:43   ` Uros Bizjak
2019-02-12 19:35     ` H.J. Lu
2019-02-12 19:44       ` Uros Bizjak
2019-02-12 20:13         ` H.J. Lu
2019-02-12 20:24           ` Uros Bizjak [this message]
2019-02-12 20:44             ` H.J. Lu
2019-02-13  8:26               ` Uros Bizjak
2019-02-12 20:29           ` Uros Bizjak
2019-02-13 19:00             ` H.J. Lu
2019-02-11 22:56 ` [PATCH 06/40] i386: Emulate MMX smulv4hi3_highpart with SSE H.J. Lu
2019-02-11 22:56 ` [PATCH 25/40] i386: Emulate MMX movntq with SSE2 movntidi H.J. Lu
2019-02-12 10:59   ` Uros Bizjak
2019-02-11 22:56 ` [PATCH 05/40] i386: Emulate MMX mulv4hi3 with SSE H.J. Lu
2019-02-11 22:56 ` [PATCH 10/40] i386: Emulate MMX mmx_andnot<mode>3 " H.J. Lu
2019-02-11 22:56 ` [PATCH 23/40] i386: Emulate MMX mmx_uavgv4hi3 " H.J. Lu
2019-02-11 22:56 ` [PATCH 34/40] i386: Emulate MMX abs<mode>2 " H.J. Lu
2019-02-11 22:57 ` [PATCH 38/40] i386: Add tests for MMX intrinsic emulations " H.J. Lu
2019-02-11 22:57 ` [PATCH 08/40] i386: Emulate MMX ashr<mode>3/<shift_insn><mode>3 " H.J. Lu
2019-02-11 23:15   ` Uros Bizjak
2019-02-11 23:35     ` Uros Bizjak
2019-02-11 22:57 ` [PATCH 22/40] i386: Emulate MMX mmx_uavgv8qi3 " H.J. Lu
2019-02-11 22:57 ` [PATCH 15/40] i386: Emulate MMX sse_cvtpi2ps " H.J. Lu
2019-02-12 10:44   ` Uros Bizjak
2019-02-11 22:57 ` [PATCH 07/40] i386: Emulate MMX mmx_pmaddwd " H.J. Lu
2019-02-11 22:57 ` [PATCH 17/40] i386: Emulate MMX mmx_pinsrw " H.J. Lu
2019-02-11 22:57 ` [PATCH 03/40] i386: Emulate MMX punpcklXX/punpckhXX with SSE punpcklXX H.J. Lu
2019-02-12 11:11   ` Uros Bizjak
2019-02-11 22:57 ` [PATCH 20/40] i386: Emulate MMX mmx_umulv4hi3_highpart with SSE H.J. Lu
2019-02-11 22:57 ` [PATCH 37/40] i386: Allow MMX intrinsic emulation " H.J. Lu
2019-02-12 12:07   ` Uros Bizjak
2019-02-13 20:21     ` H.J. Lu
2019-02-13 22:51       ` Uros Bizjak
2019-02-13 23:03         ` H.J. Lu
2019-02-14  8:16           ` Uros Bizjak
2019-02-14  9:44             ` Richard Biener
2019-02-14 10:14               ` Uros Bizjak
2019-02-11 22:57 ` [PATCH 39/40] i386: Also enable SSSE3 __m64 tests in 64-bit mode H.J. Lu
2019-02-11 22:57 ` [PATCH 40/40] i386: Enable 8-byte vectorizer for TARGET_MMX_WITH_SSE H.J. Lu
2019-02-11 22:57 ` [PATCH 33/40] i386: Emulate MMX ssse3_palignrdi with SSE H.J. Lu
2019-02-12 11:27   ` Uros Bizjak
2019-02-11 22:57 ` [PATCH 32/40] i386: Emulate MMX ssse3_psign<mode>3 " H.J. Lu
2019-02-11 23:21 ` [PATCH 19/40] i386: Emulate MMX mmx_pmovmskb " H.J. Lu
2019-02-12 11:15   ` Uros Bizjak
2019-02-14 12:31 [PATCH 00/40] V5: Emulate MMX intrinsics " H.J. Lu
2019-02-14 12:33 ` [PATCH 36/40] i386: Allow MMX vector expanders with TARGET_MMX_WITH_SSE H.J. Lu

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='CAFULd4bK01HeviHh2c1HuJSbSdTxv=46smMTZoD8FhVcMNoJeg@mail.gmail.com' \
    --to=ubizjak@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@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).