1 /* Copyright (C) 2013-2015 Free Software Foundation, Inc.
3 This file is part of GCC.
5 GCC is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 3, or (at your option)
10 GCC is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 Under Section 7 of GPL version 3, you are granted additional
16 permissions described in the GCC Runtime Library Exception, version
17 3.1, as published by the Free Software Foundation.
19 You should have received a copy of the GNU General Public License and
20 a copy of the GCC Runtime Library Exception along with this program;
21 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
22 <http://www.gnu.org/licenses/>. */
24 #ifndef _IMMINTRIN_H_INCLUDED
25 #error "Never use <avx512pfintrin.h> directly; include <immintrin.h> instead."
28 #ifndef _AVX512PFINTRIN_H_INCLUDED
29 #define _AVX512PFINTRIN_H_INCLUDED
32 #pragma GCC push_options
33 #pragma GCC target("avx512pf")
34 #define __DISABLE_AVX512PF__
35 #endif /* __AVX512PF__ */
37 /* Internal data types for implementing the intrinsics. */
38 typedef long long __v8di __attribute__ ((__vector_size__ (64)));
39 typedef int __v16si __attribute__ ((__vector_size__ (64)));
41 /* The Intel API is flexible enough that we must allow aliasing with other
42 vector types, and their scalar components. */
43 typedef long long __m512i __attribute__ ((__vector_size__ (64), __may_alias__));
45 typedef unsigned char __mmask8;
46 typedef unsigned short __mmask16;
50 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
51 _mm512_mask_prefetch_i32gather_pd (__m256i index, __mmask8 mask,
52 void *addr, int scale, int hint)
54 __builtin_ia32_gatherpfdpd (mask, (__v8si) index, (long long const *) addr,
59 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
60 _mm512_mask_prefetch_i32gather_ps (__m512i index, __mmask16 mask,
61 void *addr, int scale, int hint)
63 __builtin_ia32_gatherpfdps (mask, (__v16si) index, (int const *) addr,
68 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
69 _mm512_mask_prefetch_i64gather_pd (__m512i index, __mmask8 mask,
70 void *addr, int scale, int hint)
72 __builtin_ia32_gatherpfqpd (mask, (__v8di) index, (long long const *) addr,
77 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
78 _mm512_mask_prefetch_i64gather_ps (__m512i index, __mmask8 mask,
79 void *addr, int scale, int hint)
81 __builtin_ia32_gatherpfqps (mask, (__v8di) index, (int const *) addr,
86 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
87 _mm512_prefetch_i32scatter_pd (void *addr, __m256i index, int scale,
90 __builtin_ia32_scatterpfdpd ((__mmask8) 0xFF, (__v8si) index,
91 (long long const *)addr, scale, hint);
95 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
96 _mm512_prefetch_i32scatter_ps (void *addr, __m512i index, int scale,
99 __builtin_ia32_scatterpfdps ((__mmask16) 0xFFFF, (__v16si) index, (int const *) addr,
104 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
105 _mm512_mask_prefetch_i32scatter_pd (void *addr, __mmask8 mask,
106 __m256i index, int scale, int hint)
108 __builtin_ia32_scatterpfdpd (mask, (__v8si) index, (long long const *) addr,
113 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
114 _mm512_mask_prefetch_i32scatter_ps (void *addr, __mmask16 mask,
115 __m512i index, int scale, int hint)
117 __builtin_ia32_scatterpfdps (mask, (__v16si) index, (int const *) addr,
122 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
123 _mm512_prefetch_i64scatter_pd (void *addr, __m512i index, int scale,
126 __builtin_ia32_scatterpfqpd ((__mmask8) 0xFF, (__v8di) index, (long long const *) addr,
131 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
132 _mm512_prefetch_i64scatter_ps (void *addr, __m512i index, int scale,
135 __builtin_ia32_scatterpfqps ((__mmask8) 0xFF, (__v8di) index, (int const *) addr,
140 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
141 _mm512_mask_prefetch_i64scatter_pd (void *addr, __mmask16 mask,
142 __m512i index, int scale, int hint)
144 __builtin_ia32_scatterpfqpd (mask, (__v8di) index, (long long const *) addr,
149 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
150 _mm512_mask_prefetch_i64scatter_ps (void *addr, __mmask16 mask,
151 __m512i index, int scale, int hint)
153 __builtin_ia32_scatterpfqps (mask, (__v8di) index, (int const *) addr,
158 #define _mm512_mask_prefetch_i32gather_pd(INDEX, MASK, ADDR, SCALE, HINT) \
159 __builtin_ia32_gatherpfdpd ((__mmask8)MASK, (__v8si)(__m256i)INDEX, \
160 (long long const *)ADDR, (int)SCALE, (int)HINT)
162 #define _mm512_mask_prefetch_i32gather_ps(INDEX, MASK, ADDR, SCALE, HINT) \
163 __builtin_ia32_gatherpfdps ((__mmask16)MASK, (__v16si)(__m512i)INDEX, \
164 (int const *)ADDR, (int)SCALE, (int)HINT)
166 #define _mm512_mask_prefetch_i64gather_pd(INDEX, MASK, ADDR, SCALE, HINT) \
167 __builtin_ia32_gatherpfqpd ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \
168 (long long const *)ADDR, (int)SCALE, (int)HINT)
170 #define _mm512_mask_prefetch_i64gather_ps(INDEX, MASK, ADDR, SCALE, HINT) \
171 __builtin_ia32_gatherpfqps ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \
172 (int const *)ADDR, (int)SCALE, (int)HINT)
174 #define _mm512_prefetch_i32scatter_pd(ADDR, INDEX, SCALE, HINT) \
175 __builtin_ia32_scatterpfdpd ((__mmask8)0xFF, (__v8si)(__m256i)INDEX, \
176 (long long const *)ADDR, (int)SCALE, (int)HINT)
178 #define _mm512_prefetch_i32scatter_ps(ADDR, INDEX, SCALE, HINT) \
179 __builtin_ia32_scatterpfdps ((__mmask16)0xFFFF, (__v16si)(__m512i)INDEX, \
180 (int const *)ADDR, (int)SCALE, (int)HINT)
182 #define _mm512_mask_prefetch_i32scatter_pd(ADDR, MASK, INDEX, SCALE, HINT) \
183 __builtin_ia32_scatterpfdpd ((__mmask8)MASK, (__v8si)(__m256i)INDEX, \
184 (long long const *)ADDR, (int)SCALE, (int)HINT)
186 #define _mm512_mask_prefetch_i32scatter_ps(ADDR, MASK, INDEX, SCALE, HINT) \
187 __builtin_ia32_scatterpfdps ((__mmask16)MASK, (__v16si)(__m512i)INDEX, \
188 (int const *)ADDR, (int)SCALE, (int)HINT)
190 #define _mm512_prefetch_i64scatter_pd(ADDR, INDEX, SCALE, HINT) \
191 __builtin_ia32_scatterpfqpd ((__mmask8)0xFF, (__v8di)(__m512i)INDEX, \
192 (long long const *)ADDR, (int)SCALE, (int)HINT)
194 #define _mm512_prefetch_i64scatter_ps(ADDR, INDEX, SCALE, HINT) \
195 __builtin_ia32_scatterpfqps ((__mmask8)0xFF, (__v8di)(__m512i)INDEX, \
196 (int const *)ADDR, (int)SCALE, (int)HINT)
198 #define _mm512_mask_prefetch_i64scatter_pd(ADDR, MASK, INDEX, SCALE, HINT) \
199 __builtin_ia32_scatterpfqpd ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \
200 (long long const *)ADDR, (int)SCALE, (int)HINT)
202 #define _mm512_mask_prefetch_i64scatter_ps(ADDR, MASK, INDEX, SCALE, HINT) \
203 __builtin_ia32_scatterpfqps ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \
204 (int const *)ADDR, (int)SCALE, (int)HINT)
207 #ifdef __DISABLE_AVX512PF__
208 #undef __DISABLE_AVX512PF__
209 #pragma GCC pop_options
210 #endif /* __DISABLE_AVX512PF__ */
212 #endif /* _AVX512PFINTRIN_H_INCLUDED */