1 |
691 |
jeremybenn |
/* { dg-do compile } */
|
2 |
|
|
/* { dg-options "-O2 -Werror-implicit-function-declaration -march=k8 -msse4a -m3dnow -mavx -mavx2 -mfma4 -mxop -maes -mpclmul -mpopcnt -mabm -mlzcnt -mbmi -mbmi2 -mtbm -mlwp -mfsgsbase -mrdrnd -mf16c -mfma" } */
|
3 |
|
|
|
4 |
|
|
#include <mm_malloc.h>
|
5 |
|
|
|
6 |
|
|
/* Test that the intrinsics compile with optimization. All of them
|
7 |
|
|
are defined as inline functions in {,x,e,p,t,s,w,a,b,i}mmintrin.h,
|
8 |
|
|
mm3dnow.h, fma4intrin.h, xopintrin.h, abmintrin.h, bmiintrin.h,
|
9 |
|
|
tbmintrin.h, lwpintrin.h, popcntintrin.h, fmaintrin.h and mm_malloc.h
|
10 |
|
|
that reference the proper builtin functions.
|
11 |
|
|
|
12 |
|
|
Defining away "extern" and "__inline" results in all of them being
|
13 |
|
|
compiled as proper functions. */
|
14 |
|
|
|
15 |
|
|
#define extern
|
16 |
|
|
#define __inline
|
17 |
|
|
|
18 |
|
|
/* Following intrinsics require immediate arguments. */
|
19 |
|
|
|
20 |
|
|
/* ammintrin.h */
|
21 |
|
|
#define __builtin_ia32_extrqi(X, I, L) __builtin_ia32_extrqi(X, 1, 1)
|
22 |
|
|
#define __builtin_ia32_insertqi(X, Y, I, L) __builtin_ia32_insertqi(X, Y, 1, 1)
|
23 |
|
|
|
24 |
|
|
/* immintrin.h */
|
25 |
|
|
#define __builtin_ia32_blendpd256(X, Y, M) __builtin_ia32_blendpd256(X, Y, 1)
|
26 |
|
|
#define __builtin_ia32_blendps256(X, Y, M) __builtin_ia32_blendps256(X, Y, 1)
|
27 |
|
|
#define __builtin_ia32_dpps256(X, Y, M) __builtin_ia32_dpps256(X, Y, 1)
|
28 |
|
|
#define __builtin_ia32_shufpd256(X, Y, M) __builtin_ia32_shufpd256(X, Y, 1)
|
29 |
|
|
#define __builtin_ia32_shufps256(X, Y, M) __builtin_ia32_shufps256(X, Y, 1)
|
30 |
|
|
#define __builtin_ia32_cmpsd(X, Y, O) __builtin_ia32_cmpsd(X, Y, 1)
|
31 |
|
|
#define __builtin_ia32_cmpss(X, Y, O) __builtin_ia32_cmpss(X, Y, 1)
|
32 |
|
|
#define __builtin_ia32_cmppd(X, Y, O) __builtin_ia32_cmppd(X, Y, 1)
|
33 |
|
|
#define __builtin_ia32_cmpps(X, Y, O) __builtin_ia32_cmpps(X, Y, 1)
|
34 |
|
|
#define __builtin_ia32_cmppd256(X, Y, O) __builtin_ia32_cmppd256(X, Y, 1)
|
35 |
|
|
#define __builtin_ia32_cmpps256(X, Y, O) __builtin_ia32_cmpps256(X, Y, 1)
|
36 |
|
|
#define __builtin_ia32_vextractf128_pd256(X, N) __builtin_ia32_vextractf128_pd256(X, 1)
|
37 |
|
|
#define __builtin_ia32_vextractf128_ps256(X, N) __builtin_ia32_vextractf128_ps256(X, 1)
|
38 |
|
|
#define __builtin_ia32_vextractf128_si256(X, N) __builtin_ia32_vextractf128_si256(X, 1)
|
39 |
|
|
#define __builtin_ia32_vpermilpd(X, N) __builtin_ia32_vpermilpd(X, 1)
|
40 |
|
|
#define __builtin_ia32_vpermilpd256(X, N) __builtin_ia32_vpermilpd256(X, 1)
|
41 |
|
|
#define __builtin_ia32_vpermilps(X, N) __builtin_ia32_vpermilps(X, 1)
|
42 |
|
|
#define __builtin_ia32_vpermilps256(X, N) __builtin_ia32_vpermilps256(X, 1)
|
43 |
|
|
#define __builtin_ia32_vpermil2pd(X, Y, C, I) __builtin_ia32_vpermil2pd(X, Y, C, 1)
|
44 |
|
|
#define __builtin_ia32_vpermil2pd256(X, Y, C, I) __builtin_ia32_vpermil2pd256(X, Y, C, 1)
|
45 |
|
|
#define __builtin_ia32_vpermil2ps(X, Y, C, I) __builtin_ia32_vpermil2ps(X, Y, C, 1)
|
46 |
|
|
#define __builtin_ia32_vpermil2ps256(X, Y, C, I) __builtin_ia32_vpermil2ps256(X, Y, C, 1)
|
47 |
|
|
#define __builtin_ia32_vperm2f128_pd256(X, Y, C) __builtin_ia32_vperm2f128_pd256(X, Y, 1)
|
48 |
|
|
#define __builtin_ia32_vperm2f128_ps256(X, Y, C) __builtin_ia32_vperm2f128_ps256(X, Y, 1)
|
49 |
|
|
#define __builtin_ia32_vperm2f128_si256(X, Y, C) __builtin_ia32_vperm2f128_si256(X, Y, 1)
|
50 |
|
|
#define __builtin_ia32_vinsertf128_pd256(X, Y, C) __builtin_ia32_vinsertf128_pd256(X, Y, 1)
|
51 |
|
|
#define __builtin_ia32_vinsertf128_ps256(X, Y, C) __builtin_ia32_vinsertf128_ps256(X, Y, 1)
|
52 |
|
|
#define __builtin_ia32_vinsertf128_si256(X, Y, C) __builtin_ia32_vinsertf128_si256(X, Y, 1)
|
53 |
|
|
#define __builtin_ia32_roundpd256(V, M) __builtin_ia32_roundpd256(V, 1)
|
54 |
|
|
#define __builtin_ia32_roundps256(V, M) __builtin_ia32_roundps256(V, 1)
|
55 |
|
|
#define __builtin_ia32_vcvtps2ph(A, I) __builtin_ia32_vcvtps2ph(A, 1)
|
56 |
|
|
#define __builtin_ia32_vcvtps2ph256(A, I) __builtin_ia32_vcvtps2ph256(A, 1)
|
57 |
|
|
|
58 |
|
|
/* wmmintrin.h */
|
59 |
|
|
#define __builtin_ia32_aeskeygenassist128(X, C) __builtin_ia32_aeskeygenassist128(X, 1)
|
60 |
|
|
#define __builtin_ia32_pclmulqdq128(X, Y, I) __builtin_ia32_pclmulqdq128(X, Y, 1)
|
61 |
|
|
|
62 |
|
|
/* smmintrin.h */
|
63 |
|
|
#define __builtin_ia32_roundpd(V, M) __builtin_ia32_roundpd(V, 1)
|
64 |
|
|
#define __builtin_ia32_roundsd(D, V, M) __builtin_ia32_roundsd(D, V, 1)
|
65 |
|
|
#define __builtin_ia32_roundps(V, M) __builtin_ia32_roundps(V, 1)
|
66 |
|
|
#define __builtin_ia32_roundss(D, V, M) __builtin_ia32_roundss(D, V, 1)
|
67 |
|
|
|
68 |
|
|
#define __builtin_ia32_pblendw128(X, Y, M) __builtin_ia32_pblendw128 (X, Y, 1)
|
69 |
|
|
#define __builtin_ia32_blendps(X, Y, M) __builtin_ia32_blendps(X, Y, 1)
|
70 |
|
|
#define __builtin_ia32_blendpd(X, Y, M) __builtin_ia32_blendpd(X, Y, 1)
|
71 |
|
|
#define __builtin_ia32_dpps(X, Y, M) __builtin_ia32_dpps(X, Y, 1)
|
72 |
|
|
#define __builtin_ia32_dppd(X, Y, M) __builtin_ia32_dppd(X, Y, 1)
|
73 |
|
|
#define __builtin_ia32_insertps128(D, S, N) __builtin_ia32_insertps128(D, S, 1)
|
74 |
|
|
#define __builtin_ia32_vec_ext_v4sf(X, N) __builtin_ia32_vec_ext_v4sf(X, 1)
|
75 |
|
|
#define __builtin_ia32_vec_set_v16qi(D, S, N) __builtin_ia32_vec_set_v16qi(D, S, 1)
|
76 |
|
|
#define __builtin_ia32_vec_set_v4si(D, S, N) __builtin_ia32_vec_set_v4si(D, S, 1)
|
77 |
|
|
#define __builtin_ia32_vec_set_v2di(D, S, N) __builtin_ia32_vec_set_v2di(D, S, 1)
|
78 |
|
|
#define __builtin_ia32_vec_ext_v16qi(X, N) __builtin_ia32_vec_ext_v16qi(X, 1)
|
79 |
|
|
#define __builtin_ia32_vec_ext_v4si(X, N) __builtin_ia32_vec_ext_v4si(X, 1)
|
80 |
|
|
#define __builtin_ia32_vec_ext_v2di(X, N) __builtin_ia32_vec_ext_v2di(X, 1)
|
81 |
|
|
#define __builtin_ia32_mpsadbw128(X, Y, M) __builtin_ia32_mpsadbw128(X, Y, 1)
|
82 |
|
|
#define __builtin_ia32_pcmpistrm128(X, Y, M) \
|
83 |
|
|
__builtin_ia32_pcmpistrm128(X, Y, 1)
|
84 |
|
|
#define __builtin_ia32_pcmpistri128(X, Y, M) \
|
85 |
|
|
__builtin_ia32_pcmpistri128(X, Y, 1)
|
86 |
|
|
#define __builtin_ia32_pcmpestrm128(X, LX, Y, LY, M) \
|
87 |
|
|
__builtin_ia32_pcmpestrm128(X, LX, Y, LY, 1)
|
88 |
|
|
#define __builtin_ia32_pcmpestri128(X, LX, Y, LY, M) \
|
89 |
|
|
__builtin_ia32_pcmpestri128(X, LX, Y, LY, 1)
|
90 |
|
|
#define __builtin_ia32_pcmpistria128(X, Y, M) \
|
91 |
|
|
__builtin_ia32_pcmpistria128(X, Y, 1)
|
92 |
|
|
#define __builtin_ia32_pcmpistric128(X, Y, M) \
|
93 |
|
|
__builtin_ia32_pcmpistric128(X, Y, 1)
|
94 |
|
|
#define __builtin_ia32_pcmpistrio128(X, Y, M) \
|
95 |
|
|
__builtin_ia32_pcmpistrio128(X, Y, 1)
|
96 |
|
|
#define __builtin_ia32_pcmpistris128(X, Y, M) \
|
97 |
|
|
__builtin_ia32_pcmpistris128(X, Y, 1)
|
98 |
|
|
#define __builtin_ia32_pcmpistriz128(X, Y, M) \
|
99 |
|
|
__builtin_ia32_pcmpistriz128(X, Y, 1)
|
100 |
|
|
#define __builtin_ia32_pcmpestria128(X, LX, Y, LY, M) \
|
101 |
|
|
__builtin_ia32_pcmpestria128(X, LX, Y, LY, 1)
|
102 |
|
|
#define __builtin_ia32_pcmpestric128(X, LX, Y, LY, M) \
|
103 |
|
|
__builtin_ia32_pcmpestric128(X, LX, Y, LY, 1)
|
104 |
|
|
#define __builtin_ia32_pcmpestrio128(X, LX, Y, LY, M) \
|
105 |
|
|
__builtin_ia32_pcmpestrio128(X, LX, Y, LY, 1)
|
106 |
|
|
#define __builtin_ia32_pcmpestris128(X, LX, Y, LY, M) \
|
107 |
|
|
__builtin_ia32_pcmpestris128(X, LX, Y, LY, 1)
|
108 |
|
|
#define __builtin_ia32_pcmpestriz128(X, LX, Y, LY, M) \
|
109 |
|
|
__builtin_ia32_pcmpestriz128(X, LX, Y, LY, 1)
|
110 |
|
|
|
111 |
|
|
/* tmmintrin.h */
|
112 |
|
|
#define __builtin_ia32_palignr128(X, Y, N) __builtin_ia32_palignr128(X, Y, 8)
|
113 |
|
|
#define __builtin_ia32_palignr(X, Y, N) __builtin_ia32_palignr(X, Y, 8)
|
114 |
|
|
|
115 |
|
|
/* emmintrin.h */
|
116 |
|
|
#define __builtin_ia32_psrldqi128(A, B) __builtin_ia32_psrldqi128(A, 8)
|
117 |
|
|
#define __builtin_ia32_pslldqi128(A, B) __builtin_ia32_pslldqi128(A, 8)
|
118 |
|
|
#define __builtin_ia32_pshufhw(A, N) __builtin_ia32_pshufhw(A, 0)
|
119 |
|
|
#define __builtin_ia32_pshuflw(A, N) __builtin_ia32_pshuflw(A, 0)
|
120 |
|
|
#define __builtin_ia32_pshufd(A, N) __builtin_ia32_pshufd(A, 0)
|
121 |
|
|
#define __builtin_ia32_vec_set_v8hi(A, D, N) \
|
122 |
|
|
__builtin_ia32_vec_set_v8hi(A, D, 0)
|
123 |
|
|
#define __builtin_ia32_vec_ext_v8hi(A, N) __builtin_ia32_vec_ext_v8hi(A, 0)
|
124 |
|
|
#define __builtin_ia32_shufpd(A, B, N) __builtin_ia32_shufpd(A, B, 0)
|
125 |
|
|
|
126 |
|
|
/* xmmintrin.h */
|
127 |
|
|
#define __builtin_prefetch(P, A, I) __builtin_prefetch(P, A, _MM_HINT_NTA)
|
128 |
|
|
#define __builtin_ia32_pshufw(A, N) __builtin_ia32_pshufw(A, 0)
|
129 |
|
|
#define __builtin_ia32_vec_set_v4hi(A, D, N) \
|
130 |
|
|
__builtin_ia32_vec_set_v4hi(A, D, 0)
|
131 |
|
|
#define __builtin_ia32_vec_ext_v4hi(A, N) __builtin_ia32_vec_ext_v4hi(A, 0)
|
132 |
|
|
#define __builtin_ia32_shufps(A, B, N) __builtin_ia32_shufps(A, B, 0)
|
133 |
|
|
|
134 |
|
|
/* xopintrin.h */
|
135 |
|
|
#define __builtin_ia32_vprotbi(A, N) __builtin_ia32_vprotbi (A,1)
|
136 |
|
|
#define __builtin_ia32_vprotwi(A, N) __builtin_ia32_vprotwi (A,1)
|
137 |
|
|
#define __builtin_ia32_vprotdi(A, N) __builtin_ia32_vprotdi (A,1)
|
138 |
|
|
#define __builtin_ia32_vprotqi(A, N) __builtin_ia32_vprotqi (A,1)
|
139 |
|
|
|
140 |
|
|
/* lwpintrin.h */
|
141 |
|
|
#define __builtin_ia32_lwpval32(D2, D1, F) __builtin_ia32_lwpval32 (D2, D1, 1)
|
142 |
|
|
#define __builtin_ia32_lwpval64(D2, D1, F) __builtin_ia32_lwpval64 (D2, D1, 1)
|
143 |
|
|
#define __builtin_ia32_lwpins32(D2, D1, F) __builtin_ia32_lwpins32 (D2, D1, 1)
|
144 |
|
|
#define __builtin_ia32_lwpins64(D2, D1, F) __builtin_ia32_lwpins64 (D2, D1, 1)
|
145 |
|
|
|
146 |
|
|
/* tbmintrin.h */
|
147 |
|
|
#define __builtin_ia32_bextri_u32(X, Y) __builtin_ia32_bextri_u32 (X, 1)
|
148 |
|
|
#define __builtin_ia32_bextri_u64(X, Y) __builtin_ia32_bextri_u64 (X, 1)
|
149 |
|
|
|
150 |
|
|
/* avx2intrin.h */
|
151 |
|
|
#define __builtin_ia32_mpsadbw256(X, Y, Z) __builtin_ia32_mpsadbw256 (X, Y, 1)
|
152 |
|
|
#define __builtin_ia32_palignr256(X, Y, Z) __builtin_ia32_palignr256 (X, Y, 8)
|
153 |
|
|
#define __builtin_ia32_pblendw256(X, Y, Z) __builtin_ia32_pblendw256 (X, Y, 1)
|
154 |
|
|
#define __builtin_ia32_pshufd256(X, Y) __builtin_ia32_pshufd256(X, 1)
|
155 |
|
|
#define __builtin_ia32_pshufhw256(X, Y) __builtin_ia32_pshufhw256(X, 1)
|
156 |
|
|
#define __builtin_ia32_pshuflw256(X, Y) __builtin_ia32_pshuflw256(X, 1)
|
157 |
|
|
#define __builtin_ia32_pslldqi256(X, Y) __builtin_ia32_pslldqi256(X, 8)
|
158 |
|
|
#define __builtin_ia32_psrldqi256(X, Y) __builtin_ia32_psrldqi256(X, 8)
|
159 |
|
|
#define __builtin_ia32_pblendd128(X, Y, Z) __builtin_ia32_pblendd128(X, Y, 1)
|
160 |
|
|
#define __builtin_ia32_pblendd256(X, Y, Z) __builtin_ia32_pblendd256(X, Y, 1)
|
161 |
|
|
#define __builtin_ia32_permdf256(X, Y) __builtin_ia32_permdf256(X, 1)
|
162 |
|
|
#define __builtin_ia32_permdi256(X, Y) __builtin_ia32_permdi256(X, 1)
|
163 |
|
|
#define __builtin_ia32_permti256(X, Y, Z) __builtin_ia32_permti256(X, Y, 1)
|
164 |
|
|
#define __builtin_ia32_extract128i256(X, Y) __builtin_ia32_extract128i256(X, 1)
|
165 |
|
|
#define __builtin_ia32_insert128i256(X, Y, Z) __builtin_ia32_insert128i256(X, Y, 1)
|
166 |
|
|
#define __builtin_ia32_gathersiv2df(X, Y, Z, K, M) __builtin_ia32_gathersiv2df(X, Y, Z, K, 1)
|
167 |
|
|
#define __builtin_ia32_gathersiv4df(X, Y, Z, K, M) __builtin_ia32_gathersiv4df(X, Y, Z, K, 1)
|
168 |
|
|
#define __builtin_ia32_gatherdiv2df(X, Y, Z, K, M) __builtin_ia32_gatherdiv2df(X, Y, Z, K, 1)
|
169 |
|
|
#define __builtin_ia32_gatherdiv4df(X, Y, Z, K, M) __builtin_ia32_gatherdiv4df(X, Y, Z, K, 1)
|
170 |
|
|
#define __builtin_ia32_gathersiv4sf(X, Y, Z, K, M) __builtin_ia32_gathersiv4sf(X, Y, Z, K, 1)
|
171 |
|
|
#define __builtin_ia32_gathersiv8sf(X, Y, Z, K, M) __builtin_ia32_gathersiv8sf(X, Y, Z, K, 1)
|
172 |
|
|
#define __builtin_ia32_gatherdiv4sf(X, Y, Z, K, M) __builtin_ia32_gatherdiv4sf(X, Y, Z, K, 1)
|
173 |
|
|
#define __builtin_ia32_gatherdiv4sf256(X, Y, Z, K, M) __builtin_ia32_gatherdiv4sf256(X, Y, Z, K, 1)
|
174 |
|
|
#define __builtin_ia32_gathersiv2di(X, Y, Z, K, M) __builtin_ia32_gathersiv2di(X, Y, Z, K, 1)
|
175 |
|
|
#define __builtin_ia32_gathersiv4di(X, Y, Z, K, M) __builtin_ia32_gathersiv4di(X, Y, Z, K, 1)
|
176 |
|
|
#define __builtin_ia32_gatherdiv2di(X, Y, Z, K, M) __builtin_ia32_gatherdiv2di(X, Y, Z, K, 1)
|
177 |
|
|
#define __builtin_ia32_gatherdiv4di(X, Y, Z, K, M) __builtin_ia32_gatherdiv4di(X, Y, Z, K, 1)
|
178 |
|
|
#define __builtin_ia32_gathersiv4si(X, Y, Z, K, M) __builtin_ia32_gathersiv4si(X, Y, Z, K, 1)
|
179 |
|
|
#define __builtin_ia32_gathersiv8si(X, Y, Z, K, M) __builtin_ia32_gathersiv8si(X, Y, Z, K, 1)
|
180 |
|
|
#define __builtin_ia32_gatherdiv4si(X, Y, Z, K, M) __builtin_ia32_gatherdiv4si(X, Y, Z, K, 1)
|
181 |
|
|
#define __builtin_ia32_gatherdiv4si256(X, Y, Z, K, M) __builtin_ia32_gatherdiv4si256(X, Y, Z, K, 1)
|
182 |
|
|
|
183 |
|
|
#include <x86intrin.h>
|