[4/4] Push no-evex512 target for 128/256 bit intrins

Message ID 20231031063703.2643896-5-haochen.jiang@intel.com
State Unresolved
Headers
Series Fix no-evex512 function attribute |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Jiang, Haochen Oct. 31, 2023, 6:37 a.m. UTC
  gcc/ChangeLog:

	PR target/111889
	* config/i386/avx512bf16intrin.h: Push no-evex512 target.
	* config/i386/avx512bf16vlintrin.h: Ditto.
	* config/i386/avx512bitalgvlintrin.h: Ditto.
	* config/i386/avx512bwintrin.h: Ditto.
	* config/i386/avx512dqintrin.h: Ditto.
	* config/i386/avx512fintrin.h: Ditto.
	* config/i386/avx512fp16intrin.h: Ditto.
	* config/i386/avx512fp16vlintrin.h: Ditto.
	* config/i386/avx512ifmavlintrin.h: Ditto.
	* config/i386/avx512vbmi2vlintrin.h: Ditto.
	* config/i386/avx512vbmivlintrin.h: Ditto.
	* config/i386/avx512vlbwintrin.h: Ditto.
	* config/i386/avx512vldqintrin.h: Ditto.
	* config/i386/avx512vlintrin.h: Ditto.
	* config/i386/avx512vnnivlintrin.h: Ditto.
	* config/i386/avx512vp2intersectvlintrin.h: Ditto.
	* config/i386/avx512vpopcntdqvlintrin.h: Ditto.

gcc/testsuite/ChangeLog:

	PR target/111889
	* gcc.target/i386/pr111889.c: New test.
---
 gcc/config/i386/avx512bf16intrin.h           |  4 ++--
 gcc/config/i386/avx512bf16vlintrin.h         |  4 ++--
 gcc/config/i386/avx512bitalgvlintrin.h       |  4 ++--
 gcc/config/i386/avx512bwintrin.h             |  4 ++--
 gcc/config/i386/avx512dqintrin.h             |  4 ++--
 gcc/config/i386/avx512fintrin.h              |  4 ++--
 gcc/config/i386/avx512fp16intrin.h           |  4 ++--
 gcc/config/i386/avx512fp16vlintrin.h         |  4 ++--
 gcc/config/i386/avx512ifmavlintrin.h         |  4 ++--
 gcc/config/i386/avx512vbmi2vlintrin.h        |  4 ++--
 gcc/config/i386/avx512vbmivlintrin.h         |  4 ++--
 gcc/config/i386/avx512vlbwintrin.h           |  4 ++--
 gcc/config/i386/avx512vldqintrin.h           |  4 ++--
 gcc/config/i386/avx512vlintrin.h             |  6 +++---
 gcc/config/i386/avx512vnnivlintrin.h         |  4 ++--
 gcc/config/i386/avx512vp2intersectvlintrin.h |  5 +++--
 gcc/config/i386/avx512vpopcntdqvlintrin.h    |  5 +++--
 gcc/testsuite/gcc.target/i386/pr111889.c     | 10 ++++++++++
 18 files changed, 47 insertions(+), 35 deletions(-)
 create mode 100644 gcc/testsuite/gcc.target/i386/pr111889.c
  

Patch

diff --git a/gcc/config/i386/avx512bf16intrin.h b/gcc/config/i386/avx512bf16intrin.h
index 94ccbf6389f..5084a8c23ed 100644
--- a/gcc/config/i386/avx512bf16intrin.h
+++ b/gcc/config/i386/avx512bf16intrin.h
@@ -28,9 +28,9 @@ 
 #ifndef _AVX512BF16INTRIN_H_INCLUDED
 #define _AVX512BF16INTRIN_H_INCLUDED
 
-#ifndef __AVX512BF16__
+#if !defined (__AVX512BF16__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512bf16")
+#pragma GCC target("avx512bf16,no-evex512")
 #define __DISABLE_AVX512BF16__
 #endif /* __AVX512BF16__ */
 
diff --git a/gcc/config/i386/avx512bf16vlintrin.h b/gcc/config/i386/avx512bf16vlintrin.h
index 78c001f55ad..a389bfe7cec 100644
--- a/gcc/config/i386/avx512bf16vlintrin.h
+++ b/gcc/config/i386/avx512bf16vlintrin.h
@@ -28,9 +28,9 @@ 
 #ifndef _AVX512BF16VLINTRIN_H_INCLUDED
 #define _AVX512BF16VLINTRIN_H_INCLUDED
 
-#if !defined(__AVX512VL__) || !defined(__AVX512BF16__)
+#if !defined(__AVX512VL__) || !defined(__AVX512BF16__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512bf16,avx512vl")
+#pragma GCC target("avx512bf16,avx512vl,no-evex512")
 #define __DISABLE_AVX512BF16VL__
 #endif /* __AVX512BF16__ */
 
diff --git a/gcc/config/i386/avx512bitalgvlintrin.h b/gcc/config/i386/avx512bitalgvlintrin.h
index 39301625601..327425ef0cb 100644
--- a/gcc/config/i386/avx512bitalgvlintrin.h
+++ b/gcc/config/i386/avx512bitalgvlintrin.h
@@ -28,9 +28,9 @@ 
 #ifndef _AVX512BITALGVLINTRIN_H_INCLUDED
 #define _AVX512BITALGVLINTRIN_H_INCLUDED
 
-#if !defined(__AVX512BITALG__) || !defined(__AVX512VL__)
+#if !defined(__AVX512BITALG__) || !defined(__AVX512VL__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512bitalg,avx512vl")
+#pragma GCC target("avx512bitalg,avx512vl,no-evex512")
 #define __DISABLE_AVX512BITALGVL__
 #endif /* __AVX512BITALGVL__ */
 
diff --git a/gcc/config/i386/avx512bwintrin.h b/gcc/config/i386/avx512bwintrin.h
index 45a46936aef..d5ce79fd073 100644
--- a/gcc/config/i386/avx512bwintrin.h
+++ b/gcc/config/i386/avx512bwintrin.h
@@ -28,9 +28,9 @@ 
 #ifndef _AVX512BWINTRIN_H_INCLUDED
 #define _AVX512BWINTRIN_H_INCLUDED
 
-#ifndef __AVX512BW__
+#if !defined (__AVX512BW__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512bw")
+#pragma GCC target("avx512bw,no-evex512")
 #define __DISABLE_AVX512BW__
 #endif /* __AVX512BW__ */
 
diff --git a/gcc/config/i386/avx512dqintrin.h b/gcc/config/i386/avx512dqintrin.h
index fb0aea70280..55a5d9fee9c 100644
--- a/gcc/config/i386/avx512dqintrin.h
+++ b/gcc/config/i386/avx512dqintrin.h
@@ -28,9 +28,9 @@ 
 #ifndef _AVX512DQINTRIN_H_INCLUDED
 #define _AVX512DQINTRIN_H_INCLUDED
 
-#ifndef __AVX512DQ__
+#if !defined (__AVX512DQ__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512dq")
+#pragma GCC target("avx512dq,no-evex512")
 #define __DISABLE_AVX512DQ__
 #endif /* __AVX512DQ__ */
 
diff --git a/gcc/config/i386/avx512fintrin.h b/gcc/config/i386/avx512fintrin.h
index 90a00bec09a..d9b25e9287d 100644
--- a/gcc/config/i386/avx512fintrin.h
+++ b/gcc/config/i386/avx512fintrin.h
@@ -28,9 +28,9 @@ 
 #ifndef _AVX512FINTRIN_H_INCLUDED
 #define _AVX512FINTRIN_H_INCLUDED
 
-#ifndef __AVX512F__
+#if !defined (__AVX512F__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512f")
+#pragma GCC target("avx512f,no-evex512")
 #define __DISABLE_AVX512F__
 #endif /* __AVX512F__ */
 
diff --git a/gcc/config/i386/avx512fp16intrin.h b/gcc/config/i386/avx512fp16intrin.h
index 12fcd64d7d6..aa708f9f5d0 100644
--- a/gcc/config/i386/avx512fp16intrin.h
+++ b/gcc/config/i386/avx512fp16intrin.h
@@ -28,9 +28,9 @@ 
 #ifndef _AVX512FP16INTRIN_H_INCLUDED
 #define _AVX512FP16INTRIN_H_INCLUDED
 
-#ifndef __AVX512FP16__
+#if !defined (__AVX512FP16__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512fp16")
+#pragma GCC target("avx512fp16,no-evex512")
 #define __DISABLE_AVX512FP16__
 #endif /* __AVX512FP16__ */
 
diff --git a/gcc/config/i386/avx512fp16vlintrin.h b/gcc/config/i386/avx512fp16vlintrin.h
index 64c52a25d8d..53449486b39 100644
--- a/gcc/config/i386/avx512fp16vlintrin.h
+++ b/gcc/config/i386/avx512fp16vlintrin.h
@@ -28,9 +28,9 @@ 
 #ifndef __AVX512FP16VLINTRIN_H_INCLUDED
 #define __AVX512FP16VLINTRIN_H_INCLUDED
 
-#if !defined(__AVX512VL__) || !defined(__AVX512FP16__)
+#if !defined(__AVX512VL__) || !defined(__AVX512FP16__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512fp16,avx512vl")
+#pragma GCC target("avx512fp16,avx512vl,no-evex512")
 #define __DISABLE_AVX512FP16VL__
 #endif /* __AVX512FP16VL__ */
 
diff --git a/gcc/config/i386/avx512ifmavlintrin.h b/gcc/config/i386/avx512ifmavlintrin.h
index cac55fe5e88..4ecc53b2bdd 100644
--- a/gcc/config/i386/avx512ifmavlintrin.h
+++ b/gcc/config/i386/avx512ifmavlintrin.h
@@ -28,9 +28,9 @@ 
 #ifndef _AVX512IFMAVLINTRIN_H_INCLUDED
 #define _AVX512IFMAVLINTRIN_H_INCLUDED
 
-#if !defined(__AVX512VL__) || !defined(__AVX512IFMA__)
+#if !defined(__AVX512VL__) || !defined(__AVX512IFMA__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512ifma,avx512vl")
+#pragma GCC target("avx512ifma,avx512vl,no-evex512")
 #define __DISABLE_AVX512IFMAVL__
 #endif /* __AVX512IFMAVL__ */
 
diff --git a/gcc/config/i386/avx512vbmi2vlintrin.h b/gcc/config/i386/avx512vbmi2vlintrin.h
index 4424adc774e..31c23fdb68c 100644
--- a/gcc/config/i386/avx512vbmi2vlintrin.h
+++ b/gcc/config/i386/avx512vbmi2vlintrin.h
@@ -28,9 +28,9 @@ 
 #ifndef _AVX512VBMI2VLINTRIN_H_INCLUDED
 #define _AVX512VBMI2VLINTRIN_H_INCLUDED
 
-#if !defined(__AVX512VL__) || !defined(__AVX512VBMI2__)
+#if !defined(__AVX512VL__) || !defined(__AVX512VBMI2__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512vbmi2,avx512vl")
+#pragma GCC target("avx512vbmi2,avx512vl,no-evex512")
 #define __DISABLE_AVX512VBMI2VL__
 #endif /* __AVX512VBMIVL__ */
 
diff --git a/gcc/config/i386/avx512vbmivlintrin.h b/gcc/config/i386/avx512vbmivlintrin.h
index acec23b742f..909706f0dbe 100644
--- a/gcc/config/i386/avx512vbmivlintrin.h
+++ b/gcc/config/i386/avx512vbmivlintrin.h
@@ -28,9 +28,9 @@ 
 #ifndef _AVX512VBMIVLINTRIN_H_INCLUDED
 #define _AVX512VBMIVLINTRIN_H_INCLUDED
 
-#if !defined(__AVX512VL__) || !defined(__AVX512VBMI__)
+#if !defined(__AVX512VL__) || !defined(__AVX512VBMI__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512vbmi,avx512vl")
+#pragma GCC target("avx512vbmi,avx512vl,no-evex512")
 #define __DISABLE_AVX512VBMIVL__
 #endif /* __AVX512VBMIVL__ */
 
diff --git a/gcc/config/i386/avx512vlbwintrin.h b/gcc/config/i386/avx512vlbwintrin.h
index 970dffc4bfe..2ed4d564d58 100644
--- a/gcc/config/i386/avx512vlbwintrin.h
+++ b/gcc/config/i386/avx512vlbwintrin.h
@@ -28,9 +28,9 @@ 
 #ifndef _AVX512VLBWINTRIN_H_INCLUDED
 #define _AVX512VLBWINTRIN_H_INCLUDED
 
-#if !defined(__AVX512VL__) || !defined(__AVX512BW__)
+#if !defined(__AVX512VL__) || !defined(__AVX512BW__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512vl,avx512bw")
+#pragma GCC target("avx512vl,avx512bw,no-evex512")
 #define __DISABLE_AVX512VLBW__
 #endif /* __AVX512VLBW__ */
 
diff --git a/gcc/config/i386/avx512vldqintrin.h b/gcc/config/i386/avx512vldqintrin.h
index 1949737fe9c..95f6da36f99 100644
--- a/gcc/config/i386/avx512vldqintrin.h
+++ b/gcc/config/i386/avx512vldqintrin.h
@@ -28,9 +28,9 @@ 
 #ifndef _AVX512VLDQINTRIN_H_INCLUDED
 #define _AVX512VLDQINTRIN_H_INCLUDED
 
-#if !defined(__AVX512VL__) || !defined(__AVX512DQ__)
+#if !defined(__AVX512VL__) || !defined(__AVX512DQ__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512vl,avx512dq")
+#pragma GCC target("avx512vl,avx512dq,no-evex512")
 #define __DISABLE_AVX512VLDQ__
 #endif /* __AVX512VLDQ__ */
 
diff --git a/gcc/config/i386/avx512vlintrin.h b/gcc/config/i386/avx512vlintrin.h
index d4932f29b56..7f4e83a4367 100644
--- a/gcc/config/i386/avx512vlintrin.h
+++ b/gcc/config/i386/avx512vlintrin.h
@@ -28,9 +28,9 @@ 
 #ifndef _AVX512VLINTRIN_H_INCLUDED
 #define _AVX512VLINTRIN_H_INCLUDED
 
-#ifndef __AVX512VL__
+#if !defined (__AVX512VL__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512vl")
+#pragma GCC target("avx512vl,no-evex512")
 #define __DISABLE_AVX512VL__
 #endif /* __AVX512VL__ */
 
@@ -13650,7 +13650,7 @@  _mm256_permutex_pd (__m256d __X, const int __M)
 
 #if !defined (__AVX512CD__) || !defined (__AVX512VL__)
 #pragma GCC push_options
-#pragma GCC target("avx512vl,avx512cd")
+#pragma GCC target("avx512vl,avx512cd,no-evex512")
 #define __DISABLE_AVX512VLCD__
 #endif
 
diff --git a/gcc/config/i386/avx512vnnivlintrin.h b/gcc/config/i386/avx512vnnivlintrin.h
index c62a6e82070..6c65a70f61c 100644
--- a/gcc/config/i386/avx512vnnivlintrin.h
+++ b/gcc/config/i386/avx512vnnivlintrin.h
@@ -28,9 +28,9 @@ 
 #ifndef _AVX512VNNIVLINTRIN_H_INCLUDED
 #define _AVX512VNNIVLINTRIN_H_INCLUDED
 
-#if !defined(__AVX512VL__) || !defined(__AVX512VNNI__)
+#if !defined(__AVX512VL__) || !defined(__AVX512VNNI__) || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512vnni,avx512vl")
+#pragma GCC target("avx512vnni,avx512vl,no-evex512")
 #define __DISABLE_AVX512VNNIVL__
 #endif /* __AVX512VNNIVL__ */
 
diff --git a/gcc/config/i386/avx512vp2intersectvlintrin.h b/gcc/config/i386/avx512vp2intersectvlintrin.h
index ce68aee71ca..cad9b07a202 100644
--- a/gcc/config/i386/avx512vp2intersectvlintrin.h
+++ b/gcc/config/i386/avx512vp2intersectvlintrin.h
@@ -28,9 +28,10 @@ 
 #ifndef _AVX512VP2INTERSECTVLINTRIN_H_INCLUDED
 #define _AVX512VP2INTERSECTVLINTRIN_H_INCLUDED
 
-#if !defined(__AVX512VP2INTERSECT__) || !defined(__AVX512VL__)
+#if !defined(__AVX512VP2INTERSECT__) || !defined(__AVX512VL__) \
+  || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512vp2intersect,avx512vl")
+#pragma GCC target("avx512vp2intersect,avx512vl,no-evex512")
 #define __DISABLE_AVX512VP2INTERSECTVL__
 #endif /* __AVX512VP2INTERSECTVL__ */
 
diff --git a/gcc/config/i386/avx512vpopcntdqvlintrin.h b/gcc/config/i386/avx512vpopcntdqvlintrin.h
index df487a269de..19b3200b85d 100644
--- a/gcc/config/i386/avx512vpopcntdqvlintrin.h
+++ b/gcc/config/i386/avx512vpopcntdqvlintrin.h
@@ -28,9 +28,10 @@ 
 #ifndef _AVX512VPOPCNTDQVLINTRIN_H_INCLUDED
 #define _AVX512VPOPCNTDQVLINTRIN_H_INCLUDED
 
-#if !defined(__AVX512VPOPCNTDQ__) || !defined(__AVX512VL__)
+#if !defined(__AVX512VPOPCNTDQ__) || !defined(__AVX512VL__) \
+  || defined (__EVEX512__)
 #pragma GCC push_options
-#pragma GCC target("avx512vpopcntdq,avx512vl")
+#pragma GCC target("avx512vpopcntdq,avx512vl,no-evex512")
 #define __DISABLE_AVX512VPOPCNTDQVL__
 #endif /* __AVX512VPOPCNTDQVL__ */
 
diff --git a/gcc/testsuite/gcc.target/i386/pr111889.c b/gcc/testsuite/gcc.target/i386/pr111889.c
new file mode 100644
index 00000000000..4f7682a28b7
--- /dev/null
+++ b/gcc/testsuite/gcc.target/i386/pr111889.c
@@ -0,0 +1,10 @@ 
+/* { dg-do compile } */
+/* { dg-options "-O2 -march=x86-64" } */
+
+#include <immintrin.h>
+
+__attribute__ ((target ("no-evex512,avx512vl")))
+__m256d foo (__m256d __W, __mmask8 __U, __m256d __A)
+{
+  return _mm256_mask_mov_pd (__W, __U, __A);
+}