avx512erintrin.h revision 280031
1227825Stheraven/*===---- avx512fintrin.h - AVX2 intrinsics -----------------------------------===
2227825Stheraven *
3227825Stheraven * Permission is hereby granted, free of charge, to any person obtaining a copy
4227825Stheraven * of this software and associated documentation files (the "Software"), to deal
5227825Stheraven * in the Software without restriction, including without limitation the rights
6227825Stheraven * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7227825Stheraven * copies of the Software, and to permit persons to whom the Software is
8227825Stheraven * furnished to do so, subject to the following conditions:
9227825Stheraven *
10278724Sdim * The above copyright notice and this permission notice shall be included in
11278724Sdim * all copies or substantial portions of the Software.
12278724Sdim *
13278724Sdim * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14227825Stheraven * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15227825Stheraven * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16227825Stheraven * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17227825Stheraven * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18227825Stheraven * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19227825Stheraven * THE SOFTWARE.
20227825Stheraven *
21227825Stheraven *===-----------------------------------------------------------------------===
22227825Stheraven */
23232950Stheraven#ifndef __IMMINTRIN_H
24227825Stheraven#error "Never use <avx512erintrin.h> directly; include <immintrin.h> instead."
25227825Stheraven#endif
26227825Stheraven
27241903Sdim#ifndef __AVX512ERINTRIN_H
28227825Stheraven#define __AVX512ERINTRIN_H
29227825Stheraven
30227825Stheraven
31227825Stheraven// rsqrt28
32227825Stheravenstatic  __inline__ __m512d __attribute__((__always_inline__, __nodebug__))
33241903Sdim_mm512_rsqrt28_round_pd (__m512d __A, int __R)
34227825Stheraven{
35227825Stheraven  return (__m512d)__builtin_ia32_rsqrt28pd_mask ((__v8df)__A,
36227825Stheraven                                                 (__v8df)_mm512_setzero_pd(),
37227825Stheraven                                                 (__mmask8)-1,
38227825Stheraven                                                 __R);
39278724Sdim}
40227825Stheravenstatic  __inline__ __m512 __attribute__((__always_inline__, __nodebug__))
41227825Stheraven_mm512_rsqrt28_round_ps(__m512 __A, int __R)
42227825Stheraven{
43227825Stheraven  return (__m512)__builtin_ia32_rsqrt28ps_mask ((__v16sf)__A,
44227825Stheraven                                                (__v16sf)_mm512_setzero_ps(),
45227825Stheraven                                                (__mmask16)-1,
46227825Stheraven                                                __R);
47227825Stheraven}
48227825Stheraven
49227825Stheravenstatic  __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
50227825Stheraven_mm_rsqrt28_round_ss(__m128 __A, __m128 __B, int __R)
51278724Sdim{
52227825Stheraven  return (__m128) __builtin_ia32_rsqrt28ss_mask ((__v4sf) __A,
53227825Stheraven             (__v4sf) __B,
54227825Stheraven             (__v4sf)
55227825Stheraven             _mm_setzero_ps (),
56227825Stheraven             (__mmask8) -1,
57227825Stheraven             __R);
58241903Sdim}
59241903Sdim
60227825Stheravenstatic  __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
61227825Stheraven_mm_rsqrt28_round_sd (__m128d __A, __m128d __B, int __R)
62241903Sdim{
63241903Sdim  return (__m128d) __builtin_ia32_rsqrt28sd_mask ((__v2df) __A,
64241903Sdim              (__v2df) __B,
65241903Sdim              (__v2df)
66241903Sdim              _mm_setzero_pd (),
67241903Sdim              (__mmask8) -1,
68241903Sdim             __R);
69241903Sdim}
70241903Sdim
71241903Sdim
72241903Sdim// rcp28
73241903Sdimstatic  __inline__ __m512d __attribute__((__always_inline__, __nodebug__))
74227825Stheraven_mm512_rcp28_round_pd (__m512d __A, int __R)
75227825Stheraven{
76227825Stheraven  return (__m512d)__builtin_ia32_rcp28pd_mask ((__v8df)__A,
77227825Stheraven                                               (__v8df)_mm512_setzero_pd(),
78227825Stheraven                                               (__mmask8)-1,
79227825Stheraven                                               __R);
80227825Stheraven}
81227825Stheraven
82227825Stheravenstatic  __inline__ __m512 __attribute__((__always_inline__, __nodebug__))
83227825Stheraven_mm512_rcp28_round_ps (__m512 __A, int __R)
84227825Stheraven{
85227825Stheraven  return (__m512)__builtin_ia32_rcp28ps_mask ((__v16sf)__A,
86278724Sdim                                              (__v16sf)_mm512_setzero_ps (),
87278724Sdim                                              (__mmask16)-1,
88                                              __R);
89}
90
91static  __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
92_mm_rcp28_round_ss (__m128 __A, __m128 __B, int __R)
93{
94  return (__m128) __builtin_ia32_rcp28ss_mask ((__v4sf) __A,
95             (__v4sf) __B,
96             (__v4sf)
97             _mm_setzero_ps (),
98             (__mmask8) -1,
99             __R);
100}
101static  __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
102_mm_rcp28_round_sd (__m128d __A, __m128d __B, int __R)
103{
104  return (__m128d) __builtin_ia32_rcp28sd_mask ((__v2df) __A,
105              (__v2df) __B,
106              (__v2df)
107              _mm_setzero_pd (),
108              (__mmask8) -1,
109             __R);
110}
111
112#endif // __AVX512ERINTRIN_H
113