Skip to content

Commit 2419409

Browse files
committed
[X86][RFC] Add new option -m[no-]evex512 to disable ZMM and 64-bit mask instructions for AVX512 features
This is an alternative of D157485 and a pre-feature to support AVX10. AVX10 Architecture Specification: https://cdrdv2.intel.com/v1/dl/getContent/784267 AVX10 Technical Paper: https://cdrdv2.intel.com/v1/dl/getContent/784343 RFC: https://discourse.llvm.org/t/rfc-design-for-avx10-feature-support/72661 Based on the feedbacks from LLVM and GCC community, we have agreed to start from supporting `-m[no-]evex512` on existing AVX512 features. The option `-mno-evex512` can be used with `-mavx512xxx` to build binaries that can run on both legacy AVX512 targets and AVX10-256. There're still arguments about what's the expected behavior when this option as well as `-mavx512xxx` used together with `-mavx10.1-256`. We decided to defer the support of `-mavx10.1` after we made consensus. Or furthermore, we start from supporting AVX10.2 and not providing any AVX10.1 options. Reviewed By: RKSimon, skan Differential Revision: https://reviews.llvm.org/D159250
1 parent 3e2d564 commit 2419409

40 files changed

+737
-510
lines changed

clang/docs/ReleaseNotes.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,9 @@ AMDGPU Support
304304
X86 Support
305305
^^^^^^^^^^^
306306

307+
- Added option ``-m[no-]evex512`` to disable ZMM and 64-bit mask instructions
308+
for AVX512 features.
309+
307310
Arm and AArch64 Support
308311
^^^^^^^^^^^^^^^^^^^^^^^
309312

clang/include/clang/Basic/BuiltinsX86.def

Lines changed: 441 additions & 441 deletions
Large diffs are not rendered by default.

clang/include/clang/Driver/Options.td

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5755,6 +5755,8 @@ def mcx16 : Flag<["-"], "mcx16">, Group<m_x86_Features_Group>;
57555755
def mno_cx16 : Flag<["-"], "mno-cx16">, Group<m_x86_Features_Group>;
57565756
def menqcmd : Flag<["-"], "menqcmd">, Group<m_x86_Features_Group>;
57575757
def mno_enqcmd : Flag<["-"], "mno-enqcmd">, Group<m_x86_Features_Group>;
5758+
def mevex512 : Flag<["-"], "mevex512">, Group<m_x86_Features_Group>;
5759+
def mno_evex512 : Flag<["-"], "mno-evex512">, Group<m_x86_Features_Group>;
57585760
def mf16c : Flag<["-"], "mf16c">, Group<m_x86_Features_Group>;
57595761
def mno_f16c : Flag<["-"], "mno-f16c">, Group<m_x86_Features_Group>;
57605762
def mfma : Flag<["-"], "mfma">, Group<m_x86_Features_Group>;

clang/lib/Basic/Targets/X86.cpp

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ bool X86TargetInfo::initFeatureMap(
119119
setFeatureEnabled(Features, F, true);
120120

121121
std::vector<std::string> UpdatedFeaturesVec;
122+
bool HasEVEX512 = true;
123+
bool HasAVX512F = false;
122124
for (const auto &Feature : FeaturesVec) {
123125
// Expand general-regs-only to -x86, -mmx and -sse
124126
if (Feature == "+general-regs-only") {
@@ -128,8 +130,17 @@ bool X86TargetInfo::initFeatureMap(
128130
continue;
129131
}
130132

133+
if (!HasAVX512F && Feature.substr(0, 7) == "+avx512")
134+
HasAVX512F = true;
135+
if (HasAVX512F && Feature == "-avx512f")
136+
HasAVX512F = false;
137+
if (HasEVEX512 && Feature == "-evex512")
138+
HasEVEX512 = false;
139+
131140
UpdatedFeaturesVec.push_back(Feature);
132141
}
142+
if (HasAVX512F && HasEVEX512)
143+
UpdatedFeaturesVec.push_back("+evex512");
133144

134145
if (!TargetInfo::initFeatureMap(Features, Diags, CPU, UpdatedFeaturesVec))
135146
return false;
@@ -228,6 +239,8 @@ bool X86TargetInfo::handleTargetFeatures(std::vector<std::string> &Features,
228239
HasF16C = true;
229240
} else if (Feature == "+gfni") {
230241
HasGFNI = true;
242+
} else if (Feature == "+evex512") {
243+
HasEVEX512 = true;
231244
} else if (Feature == "+avx512cd") {
232245
HasAVX512CD = true;
233246
} else if (Feature == "+avx512vpopcntdq") {
@@ -731,6 +744,8 @@ void X86TargetInfo::getTargetDefines(const LangOptions &Opts,
731744
if (HasGFNI)
732745
Builder.defineMacro("__GFNI__");
733746

747+
if (HasEVEX512)
748+
Builder.defineMacro("__EVEX512__");
734749
if (HasAVX512CD)
735750
Builder.defineMacro("__AVX512CD__");
736751
if (HasAVX512VPOPCNTDQ)
@@ -986,6 +1001,7 @@ bool X86TargetInfo::isValidFeatureName(StringRef Name) const {
9861001
.Case("crc32", true)
9871002
.Case("cx16", true)
9881003
.Case("enqcmd", true)
1004+
.Case("evex512", true)
9891005
.Case("f16c", true)
9901006
.Case("fma", true)
9911007
.Case("fma4", true)
@@ -1093,6 +1109,7 @@ bool X86TargetInfo::hasFeature(StringRef Feature) const {
10931109
.Case("cx8", HasCX8)
10941110
.Case("cx16", HasCX16)
10951111
.Case("enqcmd", HasENQCMD)
1112+
.Case("evex512", HasEVEX512)
10961113
.Case("f16c", HasF16C)
10971114
.Case("fma", HasFMA)
10981115
.Case("fma4", XOPLevel >= FMA4)
@@ -1533,8 +1550,9 @@ bool X86TargetInfo::validateOperandSize(const llvm::StringMap<bool> &FeatureMap,
15331550
return Size <= 64;
15341551
case 'z':
15351552
// XMM0/YMM/ZMM0
1536-
if (hasFeatureEnabled(FeatureMap, "avx512f"))
1537-
// ZMM0 can be used if target supports AVX512F.
1553+
if (hasFeatureEnabled(FeatureMap, "avx512f") &&
1554+
hasFeatureEnabled(FeatureMap, "evex512"))
1555+
// ZMM0 can be used if target supports AVX512F and EVEX512 is set.
15381556
return Size <= 512U;
15391557
else if (hasFeatureEnabled(FeatureMap, "avx"))
15401558
// YMM0 can be used if target supports AVX.
@@ -1553,8 +1571,10 @@ bool X86TargetInfo::validateOperandSize(const llvm::StringMap<bool> &FeatureMap,
15531571
break;
15541572
case 'v':
15551573
case 'x':
1556-
if (hasFeatureEnabled(FeatureMap, "avx512f"))
1557-
// 512-bit zmm registers can be used if target supports AVX512F.
1574+
if (hasFeatureEnabled(FeatureMap, "avx512f") &&
1575+
hasFeatureEnabled(FeatureMap, "evex512"))
1576+
// 512-bit zmm registers can be used if target supports AVX512F and
1577+
// EVEX512 is set.
15581578
return Size <= 512U;
15591579
else if (hasFeatureEnabled(FeatureMap, "avx"))
15601580
// 256-bit ymm registers can be used if target supports AVX.

clang/lib/Basic/Targets/X86.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ class LLVM_LIBRARY_VISIBILITY X86TargetInfo : public TargetInfo {
9595
bool HasLWP = false;
9696
bool HasFMA = false;
9797
bool HasF16C = false;
98+
bool HasEVEX512 = false;
9899
bool HasAVX512CD = false;
99100
bool HasAVX512VPOPCNTDQ = false;
100101
bool HasAVX512VNNI = false;

clang/lib/CodeGen/Targets/X86.cpp

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1508,15 +1508,33 @@ static bool checkAVXParamFeature(DiagnosticsEngine &Diag,
15081508
return false;
15091509
}
15101510

1511+
static bool checkAVX512ParamFeature(DiagnosticsEngine &Diag,
1512+
SourceLocation CallLoc,
1513+
const llvm::StringMap<bool> &CallerMap,
1514+
const llvm::StringMap<bool> &CalleeMap,
1515+
QualType Ty, bool IsArgument) {
1516+
bool Caller256 = CallerMap.lookup("avx512f") && !CallerMap.lookup("evex512");
1517+
bool Callee256 = CalleeMap.lookup("avx512f") && !CalleeMap.lookup("evex512");
1518+
1519+
// Forbid 512-bit or larger vector pass or return when we disabled ZMM
1520+
// instructions.
1521+
if (Caller256 || Callee256)
1522+
return Diag.Report(CallLoc, diag::err_avx_calling_convention)
1523+
<< IsArgument << Ty << "evex512";
1524+
1525+
return checkAVXParamFeature(Diag, CallLoc, CallerMap, CalleeMap, Ty,
1526+
"avx512f", IsArgument);
1527+
}
1528+
15111529
static bool checkAVXParam(DiagnosticsEngine &Diag, ASTContext &Ctx,
15121530
SourceLocation CallLoc,
15131531
const llvm::StringMap<bool> &CallerMap,
15141532
const llvm::StringMap<bool> &CalleeMap, QualType Ty,
15151533
bool IsArgument) {
15161534
uint64_t Size = Ctx.getTypeSize(Ty);
15171535
if (Size > 256)
1518-
return checkAVXParamFeature(Diag, CallLoc, CallerMap, CalleeMap, Ty,
1519-
"avx512f", IsArgument);
1536+
return checkAVX512ParamFeature(Diag, CallLoc, CallerMap, CalleeMap, Ty,
1537+
IsArgument);
15201538

15211539
if (Size > 128)
15221540
return checkAVXParamFeature(Diag, CallLoc, CallerMap, CalleeMap, Ty, "avx",

clang/lib/Headers/avx512bf16intrin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ typedef __bf16 __m512bh __attribute__((__vector_size__(64), __aligned__(64)));
2020
typedef __bf16 __bfloat16 __attribute__((deprecated("use __bf16 instead")));
2121

2222
#define __DEFAULT_FN_ATTRS512 \
23-
__attribute__((__always_inline__, __nodebug__, __target__("avx512bf16"), \
23+
__attribute__((__always_inline__, __nodebug__, __target__("avx512bf16,evex512"), \
2424
__min_vector_width__(512)))
2525
#define __DEFAULT_FN_ATTRS \
2626
__attribute__((__always_inline__, __nodebug__, __target__("avx512bf16")))

clang/lib/Headers/avx512bitalgintrin.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
#define __AVX512BITALGINTRIN_H
1616

1717
/* Define the default attributes for the functions in this file. */
18-
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512bitalg"), __min_vector_width__(512)))
18+
#define __DEFAULT_FN_ATTRS \
19+
__attribute__((__always_inline__, __nodebug__, \
20+
__target__("avx512bitalg,evex512"), \
21+
__min_vector_width__(512)))
1922

2023
static __inline__ __m512i __DEFAULT_FN_ATTRS
2124
_mm512_popcnt_epi16(__m512i __A)

clang/lib/Headers/avx512bwintrin.h

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ typedef unsigned int __mmask32;
1818
typedef unsigned long long __mmask64;
1919

2020
/* Define the default attributes for the functions in this file. */
21-
#define __DEFAULT_FN_ATTRS512 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw"), __min_vector_width__(512)))
21+
#define __DEFAULT_FN_ATTRS512 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,evex512"), __min_vector_width__(512)))
22+
#define __DEFAULT_FN_ATTRS64 __attribute__((__always_inline__, __nodebug__, __target__("avx512bw,evex512")))
2223
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512bw")))
2324

2425
static __inline __mmask32 __DEFAULT_FN_ATTRS
@@ -27,7 +28,7 @@ _knot_mask32(__mmask32 __M)
2728
return __builtin_ia32_knotsi(__M);
2829
}
2930

30-
static __inline __mmask64 __DEFAULT_FN_ATTRS
31+
static __inline __mmask64 __DEFAULT_FN_ATTRS64
3132
_knot_mask64(__mmask64 __M)
3233
{
3334
return __builtin_ia32_knotdi(__M);
@@ -39,7 +40,7 @@ _kand_mask32(__mmask32 __A, __mmask32 __B)
3940
return (__mmask32)__builtin_ia32_kandsi((__mmask32)__A, (__mmask32)__B);
4041
}
4142

42-
static __inline__ __mmask64 __DEFAULT_FN_ATTRS
43+
static __inline__ __mmask64 __DEFAULT_FN_ATTRS64
4344
_kand_mask64(__mmask64 __A, __mmask64 __B)
4445
{
4546
return (__mmask64)__builtin_ia32_kanddi((__mmask64)__A, (__mmask64)__B);
@@ -51,7 +52,7 @@ _kandn_mask32(__mmask32 __A, __mmask32 __B)
5152
return (__mmask32)__builtin_ia32_kandnsi((__mmask32)__A, (__mmask32)__B);
5253
}
5354

54-
static __inline__ __mmask64 __DEFAULT_FN_ATTRS
55+
static __inline__ __mmask64 __DEFAULT_FN_ATTRS64
5556
_kandn_mask64(__mmask64 __A, __mmask64 __B)
5657
{
5758
return (__mmask64)__builtin_ia32_kandndi((__mmask64)__A, (__mmask64)__B);
@@ -63,7 +64,7 @@ _kor_mask32(__mmask32 __A, __mmask32 __B)
6364
return (__mmask32)__builtin_ia32_korsi((__mmask32)__A, (__mmask32)__B);
6465
}
6566

66-
static __inline__ __mmask64 __DEFAULT_FN_ATTRS
67+
static __inline__ __mmask64 __DEFAULT_FN_ATTRS64
6768
_kor_mask64(__mmask64 __A, __mmask64 __B)
6869
{
6970
return (__mmask64)__builtin_ia32_kordi((__mmask64)__A, (__mmask64)__B);
@@ -75,7 +76,7 @@ _kxnor_mask32(__mmask32 __A, __mmask32 __B)
7576
return (__mmask32)__builtin_ia32_kxnorsi((__mmask32)__A, (__mmask32)__B);
7677
}
7778

78-
static __inline__ __mmask64 __DEFAULT_FN_ATTRS
79+
static __inline__ __mmask64 __DEFAULT_FN_ATTRS64
7980
_kxnor_mask64(__mmask64 __A, __mmask64 __B)
8081
{
8182
return (__mmask64)__builtin_ia32_kxnordi((__mmask64)__A, (__mmask64)__B);
@@ -87,7 +88,7 @@ _kxor_mask32(__mmask32 __A, __mmask32 __B)
8788
return (__mmask32)__builtin_ia32_kxorsi((__mmask32)__A, (__mmask32)__B);
8889
}
8990

90-
static __inline__ __mmask64 __DEFAULT_FN_ATTRS
91+
static __inline__ __mmask64 __DEFAULT_FN_ATTRS64
9192
_kxor_mask64(__mmask64 __A, __mmask64 __B)
9293
{
9394
return (__mmask64)__builtin_ia32_kxordi((__mmask64)__A, (__mmask64)__B);
@@ -111,19 +112,19 @@ _kortest_mask32_u8(__mmask32 __A, __mmask32 __B, unsigned char *__C) {
111112
return (unsigned char)__builtin_ia32_kortestzsi(__A, __B);
112113
}
113114

114-
static __inline__ unsigned char __DEFAULT_FN_ATTRS
115+
static __inline__ unsigned char __DEFAULT_FN_ATTRS64
115116
_kortestc_mask64_u8(__mmask64 __A, __mmask64 __B)
116117
{
117118
return (unsigned char)__builtin_ia32_kortestcdi(__A, __B);
118119
}
119120

120-
static __inline__ unsigned char __DEFAULT_FN_ATTRS
121+
static __inline__ unsigned char __DEFAULT_FN_ATTRS64
121122
_kortestz_mask64_u8(__mmask64 __A, __mmask64 __B)
122123
{
123124
return (unsigned char)__builtin_ia32_kortestzdi(__A, __B);
124125
}
125126

126-
static __inline__ unsigned char __DEFAULT_FN_ATTRS
127+
static __inline__ unsigned char __DEFAULT_FN_ATTRS64
127128
_kortest_mask64_u8(__mmask64 __A, __mmask64 __B, unsigned char *__C) {
128129
*__C = (unsigned char)__builtin_ia32_kortestcdi(__A, __B);
129130
return (unsigned char)__builtin_ia32_kortestzdi(__A, __B);
@@ -147,19 +148,19 @@ _ktest_mask32_u8(__mmask32 __A, __mmask32 __B, unsigned char *__C) {
147148
return (unsigned char)__builtin_ia32_ktestzsi(__A, __B);
148149
}
149150

150-
static __inline__ unsigned char __DEFAULT_FN_ATTRS
151+
static __inline__ unsigned char __DEFAULT_FN_ATTRS64
151152
_ktestc_mask64_u8(__mmask64 __A, __mmask64 __B)
152153
{
153154
return (unsigned char)__builtin_ia32_ktestcdi(__A, __B);
154155
}
155156

156-
static __inline__ unsigned char __DEFAULT_FN_ATTRS
157+
static __inline__ unsigned char __DEFAULT_FN_ATTRS64
157158
_ktestz_mask64_u8(__mmask64 __A, __mmask64 __B)
158159
{
159160
return (unsigned char)__builtin_ia32_ktestzdi(__A, __B);
160161
}
161162

162-
static __inline__ unsigned char __DEFAULT_FN_ATTRS
163+
static __inline__ unsigned char __DEFAULT_FN_ATTRS64
163164
_ktest_mask64_u8(__mmask64 __A, __mmask64 __B, unsigned char *__C) {
164165
*__C = (unsigned char)__builtin_ia32_ktestcdi(__A, __B);
165166
return (unsigned char)__builtin_ia32_ktestzdi(__A, __B);
@@ -171,7 +172,7 @@ _kadd_mask32(__mmask32 __A, __mmask32 __B)
171172
return (__mmask32)__builtin_ia32_kaddsi((__mmask32)__A, (__mmask32)__B);
172173
}
173174

174-
static __inline__ __mmask64 __DEFAULT_FN_ATTRS
175+
static __inline__ __mmask64 __DEFAULT_FN_ATTRS64
175176
_kadd_mask64(__mmask64 __A, __mmask64 __B)
176177
{
177178
return (__mmask64)__builtin_ia32_kadddi((__mmask64)__A, (__mmask64)__B);
@@ -194,7 +195,7 @@ _cvtmask32_u32(__mmask32 __A) {
194195
return (unsigned int)__builtin_ia32_kmovd((__mmask32)__A);
195196
}
196197

197-
static __inline__ unsigned long long __DEFAULT_FN_ATTRS
198+
static __inline__ unsigned long long __DEFAULT_FN_ATTRS64
198199
_cvtmask64_u64(__mmask64 __A) {
199200
return (unsigned long long)__builtin_ia32_kmovq((__mmask64)__A);
200201
}
@@ -204,7 +205,7 @@ _cvtu32_mask32(unsigned int __A) {
204205
return (__mmask32)__builtin_ia32_kmovd((__mmask32)__A);
205206
}
206207

207-
static __inline__ __mmask64 __DEFAULT_FN_ATTRS
208+
static __inline__ __mmask64 __DEFAULT_FN_ATTRS64
208209
_cvtu64_mask64(unsigned long long __A) {
209210
return (__mmask64)__builtin_ia32_kmovq((__mmask64)__A);
210211
}
@@ -214,7 +215,7 @@ _load_mask32(__mmask32 *__A) {
214215
return (__mmask32)__builtin_ia32_kmovd(*(__mmask32 *)__A);
215216
}
216217

217-
static __inline__ __mmask64 __DEFAULT_FN_ATTRS
218+
static __inline__ __mmask64 __DEFAULT_FN_ATTRS64
218219
_load_mask64(__mmask64 *__A) {
219220
return (__mmask64)__builtin_ia32_kmovq(*(__mmask64 *)__A);
220221
}
@@ -224,7 +225,7 @@ _store_mask32(__mmask32 *__A, __mmask32 __B) {
224225
*(__mmask32 *)__A = __builtin_ia32_kmovd((__mmask32)__B);
225226
}
226227

227-
static __inline__ void __DEFAULT_FN_ATTRS
228+
static __inline__ void __DEFAULT_FN_ATTRS64
228229
_store_mask64(__mmask64 *__A, __mmask64 __B) {
229230
*(__mmask64 *)__A = __builtin_ia32_kmovq((__mmask64)__B);
230231
}
@@ -1714,7 +1715,7 @@ _mm512_maskz_set1_epi8 (__mmask64 __M, char __A)
17141715
(__v64qi) _mm512_setzero_si512());
17151716
}
17161717

1717-
static __inline__ __mmask64 __DEFAULT_FN_ATTRS
1718+
static __inline__ __mmask64 __DEFAULT_FN_ATTRS64
17181719
_mm512_kunpackd (__mmask64 __A, __mmask64 __B)
17191720
{
17201721
return (__mmask64) __builtin_ia32_kunpckdi ((__mmask64) __A,

clang/lib/Headers/avx512cdintrin.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
#define __AVX512CDINTRIN_H
1616

1717
/* Define the default attributes for the functions in this file. */
18-
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512cd"), __min_vector_width__(512)))
18+
#define __DEFAULT_FN_ATTRS \
19+
__attribute__((__always_inline__, __nodebug__, \
20+
__target__("avx512cd,evex512"), __min_vector_width__(512)))
1921

2022
static __inline__ __m512i __DEFAULT_FN_ATTRS
2123
_mm512_conflict_epi64 (__m512i __A)

clang/lib/Headers/avx512dqintrin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#define __AVX512DQINTRIN_H
1616

1717
/* Define the default attributes for the functions in this file. */
18-
#define __DEFAULT_FN_ATTRS512 __attribute__((__always_inline__, __nodebug__, __target__("avx512dq"), __min_vector_width__(512)))
18+
#define __DEFAULT_FN_ATTRS512 __attribute__((__always_inline__, __nodebug__, __target__("avx512dq,evex512"), __min_vector_width__(512)))
1919
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512dq")))
2020

2121
static __inline __mmask8 __DEFAULT_FN_ATTRS

clang/lib/Headers/avx512fintrin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ typedef enum
167167
} _MM_MANTISSA_SIGN_ENUM;
168168

169169
/* Define the default attributes for the functions in this file. */
170-
#define __DEFAULT_FN_ATTRS512 __attribute__((__always_inline__, __nodebug__, __target__("avx512f"), __min_vector_width__(512)))
170+
#define __DEFAULT_FN_ATTRS512 __attribute__((__always_inline__, __nodebug__, __target__("avx512f,evex512"), __min_vector_width__(512)))
171171
#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512f"), __min_vector_width__(128)))
172172
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512f")))
173173

clang/lib/Headers/avx512fp16intrin.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ typedef _Float16 __m512h_u __attribute__((__vector_size__(64), __aligned__(1)));
2222

2323
/* Define the default attributes for the functions in this file. */
2424
#define __DEFAULT_FN_ATTRS512 \
25-
__attribute__((__always_inline__, __nodebug__, __target__("avx512fp16"), \
26-
__min_vector_width__(512)))
25+
__attribute__((__always_inline__, __nodebug__, \
26+
__target__("avx512fp16,evex512"), __min_vector_width__(512)))
2727
#define __DEFAULT_FN_ATTRS256 \
2828
__attribute__((__always_inline__, __nodebug__, __target__("avx512fp16"), \
2929
__min_vector_width__(256)))

clang/lib/Headers/avx512ifmaintrin.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
#define __IFMAINTRIN_H
1616

1717
/* Define the default attributes for the functions in this file. */
18-
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512ifma"), __min_vector_width__(512)))
18+
#define __DEFAULT_FN_ATTRS \
19+
__attribute__((__always_inline__, __nodebug__, \
20+
__target__("avx512ifma,evex512"), __min_vector_width__(512)))
1921

2022
static __inline__ __m512i __DEFAULT_FN_ATTRS
2123
_mm512_madd52hi_epu64 (__m512i __X, __m512i __Y, __m512i __Z)

clang/lib/Headers/avx512vbmi2intrin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#define __AVX512VBMI2INTRIN_H
1616

1717
/* Define the default attributes for the functions in this file. */
18-
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi2"), __min_vector_width__(512)))
18+
#define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi2,evex512"), __min_vector_width__(512)))
1919

2020

2121
static __inline__ __m512i __DEFAULT_FN_ATTRS

0 commit comments

Comments
 (0)