public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: liuhongt <hongtao.liu@intel.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [PATCH V3] [x86] Fix incorrect _mm_cvtsbh_ss.
Date: Fri, 25 Nov 2022 10:18:11 +0100	[thread overview]
Message-ID: <Y4CIU4SDWesljqZf@tucnak> (raw)
In-Reply-To: <20221125053904.1984263-1-hongtao.liu@intel.com>

On Fri, Nov 25, 2022 at 01:39:04PM +0800, liuhongt wrote:
> Update in V3:
> Remove !flag_signaling_nans since there's already HONOR_NANS (BFmode).
> 
> Here's the patch:
> 
> After supporting real __bf16, the implementation of _mm_cvtsbh_ss went
> wrong.
> 
> The patch add a builtin to generate pslld for the intrinsic, also
> extendbfsf2 is supported with pslld when !HONOR_NANS (BFmode).
> 
> truncsfbf2 is supported with vcvtneps2bf16 when
> !HONOR_NANS (BFmode) && flag_unsafe_math_optimizations.
> 
> gcc/ChangeLog:
> 
> 	PR target/107748
> 	* config/i386/avx512bf16intrin.h (_mm_cvtsbh_ss): Refined.
> 	* config/i386/i386-builtin-types.def (FLOAT_FTYPE_BFLOAT16):
> 	New function type.
> 	* config/i386/i386-builtin.def (BDESC): New builtin.
> 	* config/i386/i386-expand.cc (ix86_expand_args_builtin):
> 	Handle the builtin.
> 	* config/i386/i386.md (extendbfsf2): New expander.
> 	(extendbfsf2_1): New define_insn.
> 	(truncsfbf2): Ditto.
> 
> gcc/testsuite/ChangeLog:
> 
> 	* gcc.target/i386/avx512bf16-cvtsbh2ss-1.c: Scan pslld.
> 	* gcc.target/i386/extendbfsf.c: New test.

LGTM.

	Jakub


      reply	other threads:[~2022-11-25  9:18 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-23 12:28 [PATCH] [x86] Fix incorrect implementation for mm_cvtsbh_ss liuhongt
2022-11-23 12:40 ` Jakub Jelinek
2022-11-23 12:59   ` Hongtao Liu
2022-11-24  1:22   ` [PATCH v2] [x86] Fix incorrect _mm_cvtsbh_ss liuhongt
2022-11-24  8:53     ` Jakub Jelinek
2022-11-24 11:30       ` Hongtao Liu
2022-11-25  5:39         ` [PATCH V3] " liuhongt
2022-11-25  9:18           ` Jakub Jelinek [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=Y4CIU4SDWesljqZf@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongtao.liu@intel.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).