blob: 0785bce992730e7c2017bbd1de7b958336118c5d [file] [log] [blame]
Elena Demikhovskyfcc6df32014-07-22 11:31:39 +00001/*===---- 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
Craig Topperb01fc312015-02-01 08:05:12 +000032#define _mm512_rsqrt28_round_pd(A, R) __extension ({ \
33 (__m512d)__builtin_ia32_rsqrt28pd_mask((__v8df)(__m512d)(A), \
34 (__v8df)_mm512_setzero_pd(), \
35 (__mmask8)-1, (R)); })
Elena Demikhovskyfcc6df32014-07-22 11:31:39 +000036
Craig Topperb01fc312015-02-01 08:05:12 +000037#define _mm512_rsqrt28_round_ps(A, R) __extension__ ({ \
38 (__m512)__builtin_ia32_rsqrt28ps_mask((__v16sf)(__m512)(A), \
39 (__v16sf)_mm512_setzero_ps(), \
40 (__mmask16)-1, (R)); })
Elena Demikhovskyfcc6df32014-07-22 11:31:39 +000041
Craig Topperb01fc312015-02-01 08:05:12 +000042#define _mm_rsqrt28_round_ss(A, B, R) __extension__ ({ \
43 (__m128)__builtin_ia32_rsqrt28ss_mask((__v4sf)(__m128)(A), \
44 (__v4sf)(__m128(B), \
45 (__v4sf)_mm_setzero_ps(), \
46 (__mmask8)-1, (R)); })
47
48#define _mm_rsqrt28_round_sd (A, B, R) __extension__ ({ \
49 (__m128d)__builtin_ia32_rsqrt28sd_mask((__v2df)(__m128d)(A), \
50 (__v2df)(__m128d)(B), \
51 (__v2df)_mm_setzero_pd(), \
52 (__mmask8)-1, (R)); })
Elena Demikhovskyfcc6df32014-07-22 11:31:39 +000053
54
55// rcp28
Craig Topperb01fc312015-02-01 08:05:12 +000056#define _mm512_rcp28_round_pd(A, R) __extension__ ({ \
57 (__m512d)__builtin_ia32_rcp28pd_mask((__v8df)(__m512d)(A), \
58 (__v8df)_mm512_setzero_pd(), \
59 (__mmask8)-1, (R)); })
Elena Demikhovskyfcc6df32014-07-22 11:31:39 +000060
Craig Topperb01fc312015-02-01 08:05:12 +000061#define _mm512_rcp28_round_ps(A, R) __extension__ ({ \
62 (__m512)__builtin_ia32_rcp28ps_mask((__v16sf)(__m512)(A), \
63 (__v16sf)_mm512_setzero_ps(), \
64 (__mmask16)-1, (R)); })
Elena Demikhovskyfcc6df32014-07-22 11:31:39 +000065
Craig Topperb01fc312015-02-01 08:05:12 +000066#define _mm_rcp28_round_ss(A, B, R) __extension__ ({ \
67 (__m128) __builtin_ia32_rcp28ss_mask ((__v4sf)(__m128)(A), \
68 (__v4sf)(__m128)(B), \
69 (__v4sf)_mm_setzero_ps(), \
70 (__mmask8)-1, (R)); })
71
72#define _mm_rcp28_round_sd(A, B, R) __extension__ ({ \
73 (__m128d)__builtin_ia32_rcp28sd_mask((__v2df)(__m128d)(A), \
74 (__v2df)(__m128d)(B), \
75 (__v2df)_mm_setzero_pd(), \
76 (__mmask8)-1, (R)); })
Elena Demikhovskyfcc6df32014-07-22 11:31:39 +000077
78#endif // __AVX512ERINTRIN_H