Project

General

Profile

Statistics
| Revision:

root / lab4 / .minix-src / include / clang-3.6 / avx512erintrin.h @ 14

History | View | Annotate | Download (4.18 KB)

1 13 up20180614
/*===---- avx512fintrin.h - AVX2 intrinsics -----------------------------------===
2
 *
3
 * Permission is hereby granted, free of charge, to any person obtaining a copy
4
 * of this software and associated documentation files (the "Software"), to deal
5
 * in the Software without restriction, including without limitation the rights
6
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
 * copies of the Software, and to permit persons to whom the Software is
8
 * furnished to do so, subject to the following conditions:
9
 *
10
 * The above copyright notice and this permission notice shall be included in
11
 * all copies or substantial portions of the Software.
12
 *
13
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
 * THE SOFTWARE.
20
 *
21
 *===-----------------------------------------------------------------------===
22
 */
23
#ifndef __IMMINTRIN_H
24
#error "Never use <avx512erintrin.h> directly; include <immintrin.h> instead."
25
#endif
26
27
#ifndef __AVX512ERINTRIN_H
28
#define __AVX512ERINTRIN_H
29
30
31
// rsqrt28
32
static  __inline__ __m512d __attribute__((__always_inline__, __nodebug__))
33
_mm512_rsqrt28_round_pd (__m512d __A, int __R)
34
{
35
  return (__m512d)__builtin_ia32_rsqrt28pd_mask ((__v8df)__A,
36
                                                 (__v8df)_mm512_setzero_pd(),
37
                                                 (__mmask8)-1,
38
                                                 __R);
39
}
40
static  __inline__ __m512 __attribute__((__always_inline__, __nodebug__))
41
_mm512_rsqrt28_round_ps(__m512 __A, int __R)
42
{
43
  return (__m512)__builtin_ia32_rsqrt28ps_mask ((__v16sf)__A,
44
                                                (__v16sf)_mm512_setzero_ps(),
45
                                                (__mmask16)-1,
46
                                                __R);
47
}
48
49
static  __inline__ __m128 __attribute__((__always_inline__, __nodebug__))
50
_mm_rsqrt28_round_ss(__m128 __A, __m128 __B, int __R)
51
{
52
  return (__m128) __builtin_ia32_rsqrt28ss_mask ((__v4sf) __A,
53
             (__v4sf) __B,
54
             (__v4sf)
55
             _mm_setzero_ps (),
56
             (__mmask8) -1,
57
             __R);
58
}
59
60
static  __inline__ __m128d __attribute__((__always_inline__, __nodebug__))
61
_mm_rsqrt28_round_sd (__m128d __A, __m128d __B, int __R)
62
{
63
  return (__m128d) __builtin_ia32_rsqrt28sd_mask ((__v2df) __A,
64
              (__v2df) __B,
65
              (__v2df)
66
              _mm_setzero_pd (),
67
              (__mmask8) -1,
68
             __R);
69
}
70
71
72
// rcp28
73
static  __inline__ __m512d __attribute__((__always_inline__, __nodebug__))
74
_mm512_rcp28_round_pd (__m512d __A, int __R)
75
{
76
  return (__m512d)__builtin_ia32_rcp28pd_mask ((__v8df)__A,
77
                                               (__v8df)_mm512_setzero_pd(),
78
                                               (__mmask8)-1,
79
                                               __R);
80
}
81
82
static  __inline__ __m512 __attribute__((__always_inline__, __nodebug__))
83
_mm512_rcp28_round_ps (__m512 __A, int __R)
84
{
85
  return (__m512)__builtin_ia32_rcp28ps_mask ((__v16sf)__A,
86
                                              (__v16sf)_mm512_setzero_ps (),
87
                                              (__mmask16)-1,
88
                                              __R);
89
}
90
91
static  __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
}
101
static  __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