1 // REQUIRES: x86-registered-target
2 // RUN: %clang_cc1 %s -triple=x86_64-linux-gnu -S -o -
9 int __attribute__((target("avx"))) bar(void) {
10 return _mm256_extract_epi32(a
, 3);
17 int __attribute__((target("avx"))) qq_avx(void) {
18 return _mm256_extract_epi32(a
, 3);
27 if (__builtin_cpu_supports("avx"))
33 // Test that fma and fma4 are both separately and combined valid for an fma intrinsic.
34 __m128
__attribute__((target("fma"))) fma_1(__m128 a
, __m128 b
, __m128 c
) {
35 return __builtin_ia32_vfmaddps(a
, b
, c
);
38 __m128
__attribute__((target("fma4"))) fma_2(__m128 a
, __m128 b
, __m128 c
) {
39 return __builtin_ia32_vfmaddps(a
, b
, c
);
42 __m128
__attribute__((target("fma,fma4"))) fma_3(__m128 a
, __m128 b
, __m128 c
) {
43 return __builtin_ia32_vfmaddps(a
, b
, c
);
46 void verifyfeaturestrings(void) {
47 (void)__builtin_cpu_supports("cmov");
48 (void)__builtin_cpu_supports("mmx");
49 (void)__builtin_cpu_supports("popcnt");
50 (void)__builtin_cpu_supports("sse");
51 (void)__builtin_cpu_supports("sse2");
52 (void)__builtin_cpu_supports("sse3");
53 (void)__builtin_cpu_supports("ssse3");
54 (void)__builtin_cpu_supports("sse4.1");
55 (void)__builtin_cpu_supports("sse4.2");
56 (void)__builtin_cpu_supports("avx");
57 (void)__builtin_cpu_supports("avx2");
58 (void)__builtin_cpu_supports("sse4a");
59 (void)__builtin_cpu_supports("fma4");
60 (void)__builtin_cpu_supports("xop");
61 (void)__builtin_cpu_supports("fma");
62 (void)__builtin_cpu_supports("avx512f");
63 (void)__builtin_cpu_supports("bmi");
64 (void)__builtin_cpu_supports("bmi2");
65 (void)__builtin_cpu_supports("aes");
66 (void)__builtin_cpu_supports("pclmul");
67 (void)__builtin_cpu_supports("avx512vl");
68 (void)__builtin_cpu_supports("avx512bw");
69 (void)__builtin_cpu_supports("avx512dq");
70 (void)__builtin_cpu_supports("avx512cd");
71 (void)__builtin_cpu_supports("avx512vbmi");
72 (void)__builtin_cpu_supports("avx512ifma");
73 (void)__builtin_cpu_supports("avx5124vnniw");
74 (void)__builtin_cpu_supports("avx5124fmaps");
75 (void)__builtin_cpu_supports("avx512vpopcntdq");
76 (void)__builtin_cpu_supports("avx512vbmi2");
77 (void)__builtin_cpu_supports("gfni");
78 (void)__builtin_cpu_supports("vpclmulqdq");
79 (void)__builtin_cpu_supports("avx512vnni");
80 (void)__builtin_cpu_supports("avx512bitalg");
81 (void)__builtin_cpu_supports("avx512bf16");
82 (void)__builtin_cpu_supports("avx512vp2intersect");
83 (void)__builtin_cpu_supports("f16c");
84 (void)__builtin_cpu_supports("avx512fp16");
85 (void)__builtin_cpu_supports("3dnow");
86 (void)__builtin_cpu_supports("adx");
87 (void)__builtin_cpu_supports("cldemote");
88 (void)__builtin_cpu_supports("clflushopt");
89 (void)__builtin_cpu_supports("clwb");
90 (void)__builtin_cpu_supports("clzero");
91 (void)__builtin_cpu_supports("cx16");
92 (void)__builtin_cpu_supports("enqcmd");
93 (void)__builtin_cpu_supports("fsgsbase");
94 (void)__builtin_cpu_supports("lwp");
95 (void)__builtin_cpu_supports("lzcnt");
96 (void)__builtin_cpu_supports("movbe");
97 (void)__builtin_cpu_supports("movdir64b");
98 (void)__builtin_cpu_supports("movdiri");
99 (void)__builtin_cpu_supports("mwaitx");
100 (void)__builtin_cpu_supports("pconfig");
101 (void)__builtin_cpu_supports("pku");
102 (void)__builtin_cpu_supports("prefetchwt1");
103 (void)__builtin_cpu_supports("prfchw");
104 (void)__builtin_cpu_supports("ptwrite");
105 (void)__builtin_cpu_supports("rdpid");
106 (void)__builtin_cpu_supports("rdrnd");
107 (void)__builtin_cpu_supports("rdseed");
108 (void)__builtin_cpu_supports("rtm");
109 (void)__builtin_cpu_supports("serialize");
110 (void)__builtin_cpu_supports("sgx");
111 (void)__builtin_cpu_supports("sha");
112 (void)__builtin_cpu_supports("shstk");
113 (void)__builtin_cpu_supports("tbm");
114 (void)__builtin_cpu_supports("tsxldtrk");
115 (void)__builtin_cpu_supports("vaes");
116 (void)__builtin_cpu_supports("waitpkg");
117 (void)__builtin_cpu_supports("wbnoinvd");
118 (void)__builtin_cpu_supports("xsave");
119 (void)__builtin_cpu_supports("xsavec");
120 (void)__builtin_cpu_supports("xsaveopt");
121 (void)__builtin_cpu_supports("xsaves");
122 (void)__builtin_cpu_supports("amx-tile");
123 (void)__builtin_cpu_supports("amx-int8");
124 (void)__builtin_cpu_supports("amx-bf16");
125 (void)__builtin_cpu_supports("uintr");
126 (void)__builtin_cpu_supports("hreset");
127 (void)__builtin_cpu_supports("kl");
128 (void)__builtin_cpu_supports("widekl");
129 (void)__builtin_cpu_supports("avxvnni");
130 (void)__builtin_cpu_supports("avxifma");
131 (void)__builtin_cpu_supports("avxvnniint8");
132 (void)__builtin_cpu_supports("avxneconvert");
133 (void)__builtin_cpu_supports("cmpccxadd");
134 (void)__builtin_cpu_supports("amx-fp16");
135 (void)__builtin_cpu_supports("prefetchi");
136 (void)__builtin_cpu_supports("raoint");
137 (void)__builtin_cpu_supports("amx-complex");
138 (void)__builtin_cpu_supports("avxvnniint16");
139 (void)__builtin_cpu_supports("sm3");
140 (void)__builtin_cpu_supports("sha512");
141 (void)__builtin_cpu_supports("sm4");
142 (void)__builtin_cpu_supports("apxf");
143 (void)__builtin_cpu_supports("usermsr");
144 (void)__builtin_cpu_supports("avx10.1-256");
145 (void)__builtin_cpu_supports("avx10.1-512");
146 (void)__builtin_cpu_supports("avx10.2-256");
147 (void)__builtin_cpu_supports("avx10.2-512");
148 (void)__builtin_cpu_supports("movrs");
151 void verifycpustrings(void) {
152 (void)__builtin_cpu_is("alderlake");
153 (void)__builtin_cpu_is("amd");
154 (void)__builtin_cpu_is("amdfam10h");
155 (void)__builtin_cpu_is("amdfam15h");
156 (void)__builtin_cpu_is("amdfam17h");
157 (void)__builtin_cpu_is("atom");
158 (void)__builtin_cpu_is("barcelona");
159 (void)__builtin_cpu_is("bdver1");
160 (void)__builtin_cpu_is("bdver2");
161 (void)__builtin_cpu_is("bdver3");
162 (void)__builtin_cpu_is("bdver4");
163 (void)__builtin_cpu_is("bonnell");
164 (void)__builtin_cpu_is("broadwell");
165 (void)__builtin_cpu_is("btver1");
166 (void)__builtin_cpu_is("btver2");
167 (void)__builtin_cpu_is("cannonlake");
168 (void)__builtin_cpu_is("cascadelake");
169 (void)__builtin_cpu_is("cooperlake");
170 (void)__builtin_cpu_is("core2");
171 (void)__builtin_cpu_is("corei7");
172 (void)__builtin_cpu_is("goldmont");
173 (void)__builtin_cpu_is("goldmont-plus");
174 (void)__builtin_cpu_is("grandridge");
175 (void)__builtin_cpu_is("graniterapids");
176 (void)__builtin_cpu_is("emeraldrapids");
177 (void)__builtin_cpu_is("graniterapids-d");
178 (void)__builtin_cpu_is("arrowlake");
179 (void)__builtin_cpu_is("arrowlake-s");
180 (void)__builtin_cpu_is("lunarlake");
181 (void)__builtin_cpu_is("clearwaterforest");
182 (void)__builtin_cpu_is("pantherlake");
183 (void)__builtin_cpu_is("haswell");
184 (void)__builtin_cpu_is("icelake-client");
185 (void)__builtin_cpu_is("icelake-server");
186 (void)__builtin_cpu_is("intel");
187 (void)__builtin_cpu_is("istanbul");
188 (void)__builtin_cpu_is("ivybridge");
189 (void)__builtin_cpu_is("knl");
190 (void)__builtin_cpu_is("knm");
191 (void)__builtin_cpu_is("meteorlake");
192 (void)__builtin_cpu_is("nehalem");
193 (void)__builtin_cpu_is("raptorlake");
194 (void)__builtin_cpu_is("rocketlake");
195 (void)__builtin_cpu_is("sandybridge");
196 (void)__builtin_cpu_is("shanghai");
197 (void)__builtin_cpu_is("sierraforest");
198 (void)__builtin_cpu_is("silvermont");
199 (void)__builtin_cpu_is("skylake");
200 (void)__builtin_cpu_is("skylake-avx512");
201 (void)__builtin_cpu_is("slm");
202 (void)__builtin_cpu_is("tigerlake");
203 (void)__builtin_cpu_is("sapphirerapids");
204 (void)__builtin_cpu_is("tremont");
205 (void)__builtin_cpu_is("gracemont");
206 (void)__builtin_cpu_is("westmere");
207 (void)__builtin_cpu_is("znver1");
208 (void)__builtin_cpu_is("znver2");
209 (void)__builtin_cpu_is("znver3");
210 (void)__builtin_cpu_is("znver4");
211 (void)__builtin_cpu_is("znver5");
212 (void)__builtin_cpu_is("diamondrapids");