public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: hongtao Liu <liuhongt@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-4180] define builtins for "shared" avxneconvert-avx512bf16vl builtins. Date: Mon, 21 Nov 2022 01:05:52 +0000 (GMT) [thread overview] Message-ID: <20221121010552.5FC6D3858D35@sourceware.org> (raw) https://gcc.gnu.org/g:183db4fb73a64bc4641604c30cdbbd9d9e8a6ed6 commit r13-4180-g183db4fb73a64bc4641604c30cdbbd9d9e8a6ed6 Author: liuhongt <hongtao.liu@intel.com> Date: Thu Nov 17 16:19:31 2022 +0800 define builtins for "shared" avxneconvert-avx512bf16vl builtins. This should fix incorrect error when call those builtin with -mavxneconvert and w/o -mavx512bf16 -mavx512vl. gcc/ChangeLog: * config/i386/i386-builtins.cc (def_builtin): Handle "shared" avx512bf16vl-avxneconvert builtins. gcc/testsuite/ChangeLog: * gcc.target/i386/avxneconvert-1.c: New test. Diff: --- gcc/config/i386/i386-builtins.cc | 2 ++ gcc/testsuite/gcc.target/i386/avxneconvert-1.c | 11 +++++++++++ 2 files changed, 13 insertions(+) diff --git a/gcc/config/i386/i386-builtins.cc b/gcc/config/i386/i386-builtins.cc index 9412cf1acc8..eacdf072244 100644 --- a/gcc/config/i386/i386-builtins.cc +++ b/gcc/config/i386/i386-builtins.cc @@ -285,6 +285,8 @@ def_builtin (HOST_WIDE_INT mask, HOST_WIDE_INT mask2, avx512vl exist. */ || (mask2 == OPTION_MASK_ISA2_AVXVNNI) || (mask2 == OPTION_MASK_ISA2_AVXIFMA) + || (mask2 == (OPTION_MASK_ISA2_AVXNECONVERT + | OPTION_MASK_ISA2_AVX512BF16)) || (lang_hooks.builtin_function == lang_hooks.builtin_function_ext_scope)) { diff --git a/gcc/testsuite/gcc.target/i386/avxneconvert-1.c b/gcc/testsuite/gcc.target/i386/avxneconvert-1.c new file mode 100644 index 00000000000..2bb129c3f72 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/avxneconvert-1.c @@ -0,0 +1,11 @@ +/* { dg-do compile } */ +/* { dg-options "-mavxneconvert -O2" } */ + +typedef float v8sf __attribute__((vector_size(32))); +typedef __bf16 v8bf __attribute__((vector_size(16))); + +v8bf +foo (v8sf a) +{ + return __builtin_ia32_cvtneps2bf16_v8sf (a); +}
reply other threads:[~2022-11-21 1:05 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20221121010552.5FC6D3858D35@sourceware.org \ --to=liuhongt@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /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: linkBe 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).