public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] i386: Fix isa attribute for TI/TF andnot mode
@ 2023-11-07  2:27 Haochen Jiang
  2023-11-07  2:39 ` Hongtao Liu
  0 siblings, 1 reply; 2+ messages in thread
From: Haochen Jiang @ 2023-11-07  2:27 UTC (permalink / raw)
  To: gcc-patches; +Cc: hongtao.liu, ubizjak

Hi all,

This patch aims fo fix the wrong isa attribute which caused regression
on PR111907.

Regtested on x86_64-pc-linux-gnu. Ok for trunk?

Thx,
Haochen

gcc/ChangeLog:

	PR target/111907
	* config/i386/i386.md (avx_noavx512vl): Add missing definition.
	* config/i386/sse.md (*andnot<mode>3): Change isa attribute from
	avx_noavx512f to avx_noavx512vl.

gcc/testsuite/ChangeLog:

	PR target/111907
	* gcc.target/i386/pr111907.c: New test.
---
 gcc/config/i386/i386.md                  | 2 ++
 gcc/config/i386/sse.md                   | 2 +-
 gcc/testsuite/gcc.target/i386/pr111907.c | 8 ++++++++
 3 files changed, 11 insertions(+), 1 deletion(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr111907.c

diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
index ecc74e9994e..8f2f6e5d908 100644
--- a/gcc/config/i386/i386.md
+++ b/gcc/config/i386/i386.md
@@ -919,6 +919,8 @@
 	 (eq_attr "isa" "avx") (symbol_ref "TARGET_AVX")
 	 (eq_attr "isa" "avx_noavx512f")
 	   (symbol_ref "TARGET_AVX && !TARGET_AVX512F")
+	 (eq_attr "isa" "avx_noavx512vl")
+	   (symbol_ref "TARGET_AVX && !TARGET_AVX512VL")
 	 (eq_attr "isa" "noavx") (symbol_ref "!TARGET_AVX")
 	 (eq_attr "isa" "avx2") (symbol_ref "TARGET_AVX2")
 	 (eq_attr "isa" "noavx2") (symbol_ref "!TARGET_AVX2")
diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index e6a5c7911d5..33198756bb0 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -5169,7 +5169,7 @@
   output_asm_insn (buf, operands);
   return "";
 }
-  [(set_attr "isa" "noavx,avx_noavx512f,avx512vl,avx512f_512")
+  [(set_attr "isa" "noavx,avx_noavx512vl,avx512vl,avx512f_512")
    (set_attr "addr" "*,gpr16,*,*")
    (set_attr "type" "sselog")
    (set (attr "prefix_data16")
diff --git a/gcc/testsuite/gcc.target/i386/pr111907.c b/gcc/testsuite/gcc.target/i386/pr111907.c
new file mode 100644
index 00000000000..5275e9400ed
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr111907.c
@@ -0,0 +1,8 @@
+/* { dg-do compile } */
+/* { dg-options "-mavx512f -mno-evex512" } */
+
+_Float128
+foo (_Float128 d, _Float128 e)
+{
+  return __builtin_copysignf128 (d, e);
+}
-- 
2.31.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] i386: Fix isa attribute for TI/TF andnot mode
  2023-11-07  2:27 [PATCH] i386: Fix isa attribute for TI/TF andnot mode Haochen Jiang
@ 2023-11-07  2:39 ` Hongtao Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Hongtao Liu @ 2023-11-07  2:39 UTC (permalink / raw)
  To: Haochen Jiang; +Cc: gcc-patches, hongtao.liu, ubizjak

On Tue, Nov 7, 2023 at 10:27 AM Haochen Jiang <haochen.jiang@intel.com> wrote:
>
> Hi all,
>
> This patch aims fo fix the wrong isa attribute which caused regression
> on PR111907.
>
> Regtested on x86_64-pc-linux-gnu. Ok for trunk?
>
> Thx,
> Haochen
>
> gcc/ChangeLog:
>
>         PR target/111907
>         * config/i386/i386.md (avx_noavx512vl): Add missing definition.
Add new isa attribute.
Others LGTM.
>         * config/i386/sse.md (*andnot<mode>3): Change isa attribute from
>         avx_noavx512f to avx_noavx512vl.
>
> gcc/testsuite/ChangeLog:
>
>         PR target/111907
>         * gcc.target/i386/pr111907.c: New test.
> ---
>  gcc/config/i386/i386.md                  | 2 ++
>  gcc/config/i386/sse.md                   | 2 +-
>  gcc/testsuite/gcc.target/i386/pr111907.c | 8 ++++++++
>  3 files changed, 11 insertions(+), 1 deletion(-)
>  create mode 100644 gcc/testsuite/gcc.target/i386/pr111907.c
>
> diff --git a/gcc/config/i386/i386.md b/gcc/config/i386/i386.md
> index ecc74e9994e..8f2f6e5d908 100644
> --- a/gcc/config/i386/i386.md
> +++ b/gcc/config/i386/i386.md
> @@ -919,6 +919,8 @@
>          (eq_attr "isa" "avx") (symbol_ref "TARGET_AVX")
>          (eq_attr "isa" "avx_noavx512f")
>            (symbol_ref "TARGET_AVX && !TARGET_AVX512F")
> +        (eq_attr "isa" "avx_noavx512vl")
> +          (symbol_ref "TARGET_AVX && !TARGET_AVX512VL")
>          (eq_attr "isa" "noavx") (symbol_ref "!TARGET_AVX")
>          (eq_attr "isa" "avx2") (symbol_ref "TARGET_AVX2")
>          (eq_attr "isa" "noavx2") (symbol_ref "!TARGET_AVX2")
> diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
> index e6a5c7911d5..33198756bb0 100644
> --- a/gcc/config/i386/sse.md
> +++ b/gcc/config/i386/sse.md
> @@ -5169,7 +5169,7 @@
>    output_asm_insn (buf, operands);
>    return "";
>  }
> -  [(set_attr "isa" "noavx,avx_noavx512f,avx512vl,avx512f_512")
> +  [(set_attr "isa" "noavx,avx_noavx512vl,avx512vl,avx512f_512")
>     (set_attr "addr" "*,gpr16,*,*")
>     (set_attr "type" "sselog")
>     (set (attr "prefix_data16")
> diff --git a/gcc/testsuite/gcc.target/i386/pr111907.c b/gcc/testsuite/gcc.target/i386/pr111907.c
> new file mode 100644
> index 00000000000..5275e9400ed
> --- /dev/null
> +++ b/gcc/testsuite/gcc.target/i386/pr111907.c
> @@ -0,0 +1,8 @@
> +/* { dg-do compile } */
> +/* { dg-options "-mavx512f -mno-evex512" } */
> +
> +_Float128
> +foo (_Float128 d, _Float128 e)
> +{
> +  return __builtin_copysignf128 (d, e);
> +}
> --
> 2.31.1
>


-- 
BR,
Hongtao

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-07  2:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-07  2:27 [PATCH] i386: Fix isa attribute for TI/TF andnot mode Haochen Jiang
2023-11-07  2:39 ` Hongtao Liu

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).