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("avx512er");
72 (void)__builtin_cpu_supports("avx512pf");
73 (void)__builtin_cpu_supports("avx512vbmi");
74 (void)__builtin_cpu_supports("avx512ifma");
75 (void)__builtin_cpu_supports("avx5124vnniw");
76 (void)__builtin_cpu_supports("avx5124fmaps");
77 (void)__builtin_cpu_supports("avx512vpopcntdq");
78 (void)__builtin_cpu_supports("avx512vbmi2");
79 (void)__builtin_cpu_supports("gfni");
80 (void)__builtin_cpu_supports("vpclmulqdq");
81 (void)__builtin_cpu_supports("avx512vnni");
82 (void)__builtin_cpu_supports("avx512bitalg");
83 (void)__builtin_cpu_supports("avx512bf16");
84 (void)__builtin_cpu_supports("avx512vp2intersect");
87 void verifycpustrings(void) {
88 (void)__builtin_cpu_is("alderlake");
89 (void)__builtin_cpu_is("amd");
90 (void)__builtin_cpu_is("amdfam10h");
91 (void)__builtin_cpu_is("amdfam15h");
92 (void)__builtin_cpu_is("amdfam17h");
93 (void)__builtin_cpu_is("atom");
94 (void)__builtin_cpu_is("barcelona");
95 (void)__builtin_cpu_is("bdver1");
96 (void)__builtin_cpu_is("bdver2");
97 (void)__builtin_cpu_is("bdver3");
98 (void)__builtin_cpu_is("bdver4");
99 (void)__builtin_cpu_is("bonnell");
100 (void)__builtin_cpu_is("broadwell");
101 (void)__builtin_cpu_is("btver1");
102 (void)__builtin_cpu_is("btver2");
103 (void)__builtin_cpu_is("cannonlake");
104 (void)__builtin_cpu_is("cascadelake");
105 (void)__builtin_cpu_is("cooperlake");
106 (void)__builtin_cpu_is("core2");
107 (void)__builtin_cpu_is("corei7");
108 (void)__builtin_cpu_is("goldmont");
109 (void)__builtin_cpu_is("goldmont-plus");
110 (void)__builtin_cpu_is("grandridge");
111 (void)__builtin_cpu_is("graniterapids");
112 (void)__builtin_cpu_is("emeraldrapids");
113 (void)__builtin_cpu_is("haswell");
114 (void)__builtin_cpu_is("icelake-client");
115 (void)__builtin_cpu_is("icelake-server");
116 (void)__builtin_cpu_is("intel");
117 (void)__builtin_cpu_is("istanbul");
118 (void)__builtin_cpu_is("ivybridge");
119 (void)__builtin_cpu_is("knl");
120 (void)__builtin_cpu_is("knm");
121 (void)__builtin_cpu_is("meteorlake");
122 (void)__builtin_cpu_is("nehalem");
123 (void)__builtin_cpu_is("raptorlake");
124 (void)__builtin_cpu_is("rocketlake");
125 (void)__builtin_cpu_is("sandybridge");
126 (void)__builtin_cpu_is("shanghai");
127 (void)__builtin_cpu_is("sierraforest");
128 (void)__builtin_cpu_is("silvermont");
129 (void)__builtin_cpu_is("skylake");
130 (void)__builtin_cpu_is("skylake-avx512");
131 (void)__builtin_cpu_is("slm");
132 (void)__builtin_cpu_is("tigerlake");
133 (void)__builtin_cpu_is("sapphirerapids");
134 (void)__builtin_cpu_is("tremont");
135 (void)__builtin_cpu_is("westmere");
136 (void)__builtin_cpu_is("znver1");
137 (void)__builtin_cpu_is("znver2");
138 (void)__builtin_cpu_is("znver3");
139 (void)__builtin_cpu_is("znver4");