public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marc Glisse <marc.glisse@inria.fr>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: gcc-patches@gcc.gnu.org, Uros Bizjak <ubizjak@gmail.com>
Subject: Re: [PATCH] x86: Add pmovzx/pmovsx patterns with SI/DI operands
Date: Sun, 30 Sep 2018 10:55:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.21.1809301033370.19100@stedding.saclay.inria.fr> (raw)
In-Reply-To: <20180929220425.4714-1-hjl.tools@gmail.com>

On Sat, 29 Sep 2018, H.J. Lu wrote:

> Add pmovzx/pmovsx patterns with SI and DI operands for pmovzx/pmovsx
> instructions which only read the low 4 or 8 bytes from the source.

Hello,

I am wondering a few things (these are questions, I am not asking for 
changes):

Should we change the builtin and make it take a shorter argument, so it is 
visible to gimple optimizers that the high part is unused? But then would 
that shorter type be v8qi (we don't really have that type) or di (risks 
trying to use general regs?)?

> +(define_insn "*sse4_1_<code>v8qiv8hi2<mask_name>"
> +  [(set (match_operand:V8HI 0 "register_operand" "=Yr,*x,v")
> +	(any_extend:V8HI
> +	  (vec_select:V8QI
> +	    (subreg:V16QI
> +	      (vec_concat:V2DI
> +	        (match_operand:DI 1 "nonimmediate_operand" "Yrm,*xm,vm")
> +		(const_int 0)) 0)
> +	    (parallel [(const_int 0) (const_int 1)
> +		       (const_int 2) (const_int 3)
> +		       (const_int 4) (const_int 5)
> +		       (const_int 6) (const_int 7)]))))]

There is code in simplify-rtx.c that handles (vec_select (vec_concat x
y) z) when vec_select only picks from x. We could extend it to handle an
intermediate subreg/cast, which would yield something like:
(any_extend:V8HI (subreg:V8QI (match_operand:DI)))
or maybe even
(any_extend:V8HI (match_operand:V8QI))
Would this be likely to work? Is it desirable?

-- 
Marc Glisse

  reply	other threads:[~2018-09-30  8:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-29 22:11 H.J. Lu
2018-09-30 10:55 ` Marc Glisse [this message]
2018-09-30 15:11   ` 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=alpine.DEB.2.21.1809301033370.19100@stedding.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).