gcc/
[official-gcc.git] / gcc / config / i386 / avx512pfintrin.h
blob4dba640458dcb60dbeaad6dec257eccae2e2a6f2
1 /* Copyright (C) 2013
2 Free Software Foundation, Inc.
4 This file is part of GCC.
6 GCC is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
11 GCC is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 Under Section 7 of GPL version 3, you are granted additional
17 permissions described in the GCC Runtime Library Exception, version
18 3.1, as published by the Free Software Foundation.
20 You should have received a copy of the GNU General Public License and
21 a copy of the GCC Runtime Library Exception along with this program;
22 see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 <http://www.gnu.org/licenses/>. */
25 #ifndef _IMMINTRIN_H_INCLUDED
26 #error "Never use <avx512pfintrin.h> directly; include <immintrin.h> instead."
27 #endif
29 #ifndef _AVX512PFINTRIN_H_INCLUDED
30 #define _AVX512PFINTRIN_H_INCLUDED
32 #ifndef __AVX512PF__
33 #pragma GCC push_options
34 #pragma GCC target("avx512pf")
35 #define __DISABLE_AVX512PF__
36 #endif /* __AVX512PF__ */
38 /* Internal data types for implementing the intrinsics. */
39 typedef long long __v8di __attribute__ ((__vector_size__ (64)));
40 typedef int __v16si __attribute__ ((__vector_size__ (64)));
42 /* The Intel API is flexible enough that we must allow aliasing with other
43 vector types, and their scalar components. */
44 typedef long long __m512i __attribute__ ((__vector_size__ (64), __may_alias__));
46 typedef unsigned char __mmask8;
47 typedef unsigned short __mmask16;
49 #ifdef __OPTIMIZE__
50 extern __inline void
51 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
52 _mm512_mask_prefetch_i32gather_ps (__m512i index, __mmask16 mask,
53 int const *addr, int scale, int hint)
55 __builtin_ia32_gatherpfdps (mask, (__v16si) index, addr, scale, hint);
58 extern __inline void
59 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
60 _mm512_mask_prefetch_i64gather_ps (__m512i index, __mmask8 mask,
61 int const *addr, int scale, int hint)
63 __builtin_ia32_gatherpfqps (mask, (__v8di) index, addr, scale, hint);
66 extern __inline void
67 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
68 _mm512_prefetch_i32scatter_ps (int const *addr, __m512i index, int scale,
69 int hint)
71 __builtin_ia32_scatterpfdps ((__mmask16) 0xFFFF, (__v16si) index, addr, scale,
72 hint);
75 extern __inline void
76 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
77 _mm512_mask_prefetch_i32scatter_ps (int const *addr, __mmask16 mask,
78 __m512i index, int scale, int hint)
80 __builtin_ia32_scatterpfdps (mask, (__v16si) index, addr, scale, hint);
83 extern __inline void
84 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
85 _mm512_prefetch_i64scatter_ps (int const *addr, __m512i index, int scale,
86 int hint)
88 __builtin_ia32_scatterpfqps ((__mmask8) 0xFF, (__v8di) index, addr, scale,
89 hint);
92 extern __inline void
93 __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
94 _mm512_mask_prefetch_i64scatter_ps (int const *addr, __mmask16 mask,
95 __m512i index, int scale, int hint)
97 __builtin_ia32_scatterpfqps (mask, (__v8di) index, addr, scale, hint);
99 #else
100 #define _mm512_mask_prefetch_i32gather_ps(INDEX, MASK, ADDR, SCALE, HINT) \
101 __builtin_ia32_gatherpfdps ((__mmask16)MASK, (__v16si)(__m512i)INDEX, \
102 (int const *)ADDR, (int)SCALE, (int)HINT)
104 #define _mm512_mask_prefetch_i64gather_ps(INDEX, MASK, ADDR, SCALE, HINT) \
105 __builtin_ia32_gatherpfqps ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \
106 (int const *)ADDR, (int)SCALE, (int)HINT)
108 #define _mm512_prefetch_i32scatter_ps(ADDR, INDEX, SCALE, HINT) \
109 __builtin_ia32_scatterpfdps ((__mmask16)0xFFFF, (__v16si)(__m512i)INDEX, \
110 (int const *)ADDR, (int)SCALE, (int)HINT)
112 #define _mm512_mask_prefetch_i32scatter_ps(ADDR, MASK, INDEX, SCALE, HINT) \
113 __builtin_ia32_scatterpfdps ((__mmask16)MASK, (__v16si)(__m512i)INDEX, \
114 (int const *)ADDR, (int)SCALE, (int)HINT)
116 #define _mm512_prefetch_i64scatter_ps(ADDR, INDEX, SCALE, HINT) \
117 __builtin_ia32_scatterpfqps ((__mmask8)0xFF, (__v8di)(__m512i)INDEX, \
118 (int const *)ADDR, (int)SCALE, (int)HINT)
120 #define _mm512_mask_prefetch_i64scatter_ps(ADDR, MASK, INDEX, SCALE, HINT) \
121 __builtin_ia32_scatterpfqps ((__mmask8)MASK, (__v8di)(__m512i)INDEX, \
122 (int const *)ADDR, (int)SCALE, (int)HINT)
123 #endif
125 #ifdef __DISABLE_AVX512PF__
126 #undef __DISABLE_AVX512PF__
127 #pragma GCC pop_options
128 #endif /* __DISABLE_AVX512PF__ */
130 #endif /* _AVX512PFINTRIN_H_INCLUDED */