public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Uros Bizjak <ubizjak@gmail.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Hongtao Liu <crazylht@gmail.com>,
	"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>,
	 Hongtao Liu <hongtao.liu@intel.com>,
	Kirill Yukhin <kirill.yukhin@gmail.com>
Subject: Re: [PATCH] x86: correct and improve "*vec_dupv2di"
Date: Thu, 15 Jun 2023 10:33:23 +0200	[thread overview]
Message-ID: <CAFULd4b+V=EWCsdpdzo0vHmn2xrgR+8x_LhcoeTwLamhSLgw_g@mail.gmail.com> (raw)
In-Reply-To: <614c258d-9168-a67e-eb51-00bb2060ded4@suse.com>

On Thu, Jun 15, 2023 at 10:15 AM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 15.06.2023 09:45, Hongtao Liu wrote:
> > On Thu, Jun 15, 2023 at 3:07 PM Uros Bizjak via Gcc-patches
> > <gcc-patches@gcc.gnu.org> wrote:
> >> On Thu, Jun 15, 2023 at 8:03 AM Jan Beulich via Gcc-patches
> >> <gcc-patches@gcc.gnu.org> wrote:
> >>> +    case 3:
> >>> +      return "%vmovddup\t{%1, %0|%0, %1}";
> >>> +    case 4:
> >>> +      return "movlhps\t%0, %0";
> >>> +    default:
> >>> +      gcc_unreachable ();
> >>> +    }
> >>> +}
> >>> +  [(set_attr "isa" "sse2_noavx,avx,avx512f,sse3,noavx")
> >>> +   (set_attr "type" "sselog1,sselog1,ssemov,sselog1,ssemov")
> >>> +   (set_attr "prefix" "orig,maybe_evex,evex,maybe_vex,orig")
> >>> +   (set_attr "mode" "TI,TI,TI,DF,V4SF")
> > alternative 2 should be XImode when !TARGET_AVX512VL.
>
> This gives me a chance to actually raise a related question I stumbled
> across several times: Which operand does the mode attribute actually
> describe? I've seen places where it's the source, but I've also seen
> places where it's the destination. Because of this mix I wasn't really
> sure that getting this attribute entirely correct is actually
> necessary, and hence I hoped it would be okay to not further complicate
> the attribute here.

It should be the mode the insn is operating in. So, zero-extended
SImode add is still operating in SImode, even if its output is DImode,
and TARGET_MMX_WITH_SSE are V4SFmode, even if their operands are all
V2SFmode.

Uros.

      reply	other threads:[~2023-06-15  8:33 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15  6:03 Jan Beulich
2023-06-15  7:07 ` Uros Bizjak
2023-06-15  7:45   ` Hongtao Liu
2023-06-15  8:15     ` Jan Beulich
2023-06-15  8:33       ` Uros Bizjak [this message]

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='CAFULd4b+V=EWCsdpdzo0vHmn2xrgR+8x_LhcoeTwLamhSLgw_g@mail.gmail.com' \
    --to=ubizjak@gmail.com \
    --cc=crazylht@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.com \
    --cc=jbeulich@suse.com \
    --cc=kirill.yukhin@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).