public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Richard Biener <richard.guenther@gmail.com>
To: Uros Bizjak <ubizjak@gmail.com>
Cc: liuhongt <hongtao.liu@intel.com>,
	gcc-patches@gcc.gnu.org, crazylht@gmail.com,
	 hjl.tools@gmail.com
Subject: Re: [PATCH] [vect]Use intermiediate integer type for float_expr/fix_trunc_expr when direct optab is not existed.
Date: Wed, 21 Jun 2023 10:19:18 +0200	[thread overview]
Message-ID: <CAFiYyc0kHHUzi9n+=f8R-GZ-P3KuaFTZUpZBBx_o333nOcMemw@mail.gmail.com> (raw)
In-Reply-To: <CAFULd4Z5kLcKNnyD8Wvc5eV-FvDu5z-MPme97fjqR2VBnPZ3Fw@mail.gmail.com>

On Wed, Jun 21, 2023 at 9:50 AM Uros Bizjak via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> On Tue, Jun 20, 2023 at 6:11 PM liuhongt via Gcc-patches
> <gcc-patches@gcc.gnu.org> wrote:
> >
> > I notice there's some refactor in vectorizable_conversion
> > for code_helper,so I've adjusted my patch to that.
> > Here's the patch I'm going to commit.
> >
> > We have already use intermidate type in case WIDEN, but not for NONE,
> > this patch extended that.
> >
> > gcc/ChangeLog:
> >
> >         PR target/110018
> >         * tree-vect-stmts.cc (vectorizable_conversion): Use
> >         intermiediate integer type for float_expr/fix_trunc_expr when
> >         direct optab is not existed.
> >
> > gcc/testsuite/ChangeLog:
> >
> >         * gcc.target/i386/pr110018-1.c: New test.
>
> > +
> > +      /* For conversions between float and smaller integer types try whether we
> > +        can use intermediate signed integer types to support the
> > +        conversion.  */
>
> I'm trying to enhance testcase coverage with explicit signed/unsigned
> types (patch attached), and I have noticed that zero-extension is used
> for unsigned types. So, the above comment that mentions only signed
> integer types is not entirely correct.

The comment says the intermediate sized vector types are always
signed (because float conversions to/from unsigned are always somewhat
awkward), but yes, if the original type was unsigned zero-extension is
used and if it was signed sign-extension.

The testcase adjustments / additions look good to me btw.

Thanks,
Richard.

>
> Uros.

  reply	other threads:[~2023-06-21  8:22 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-02  1:00 liuhongt
2023-06-20  8:38 ` Richard Biener
2023-06-20  9:09   ` Hongtao Liu
2023-06-20  9:22     ` Richard Biener
2023-06-20 16:11       ` liuhongt
2023-06-21  7:49         ` Uros Bizjak
2023-06-21  8:19           ` Richard Biener [this message]
2023-06-21 14:37             ` Uros Bizjak
2023-06-22 20:36         ` Thiago Jung Bauermann
2023-06-21  9:10   ` Richard Sandiford
2023-06-21  9:32     ` Richard Sandiford
2023-06-21 11:04       ` Richard Biener
2023-06-21 11:20         ` Richard Sandiford
2023-06-21 20:39         ` Joseph Myers
2023-06-22  7:32           ` Richard Biener
2023-07-12  9:19             ` Robin Dapp

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='CAFiYyc0kHHUzi9n+=f8R-GZ-P3KuaFTZUpZBBx_o333nOcMemw@mail.gmail.com' \
    --to=richard.guenther@gmail.com \
    --cc=crazylht@gmail.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hjl.tools@gmail.com \
    --cc=hongtao.liu@intel.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).