Clang Project

clang_source_code/lib/Headers/avx512ifmavlintrin.h
1/*===------------- avx512ifmavlintrin.h - IFMA intrinsics ------------------===
2 *
3 *
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to deal
6 * in the Software without restriction, including without limitation the rights
7 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8 * copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
10 *
11 * The above copyright notice and this permission notice shall be included in
12 * all copies or substantial portions of the Software.
13 *
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20 * THE SOFTWARE.
21 *
22 *===-----------------------------------------------------------------------===
23 */
24#ifndef __IMMINTRIN_H
25#error "Never use <avx512ifmavlintrin.h> directly; include <immintrin.h> instead."
26#endif
27
28#ifndef __IFMAVLINTRIN_H
29#define __IFMAVLINTRIN_H
30
31/* Define the default attributes for the functions in this file. */
32#define __DEFAULT_FN_ATTRS128 __attribute__((__always_inline__, __nodebug__, __target__("avx512ifma,avx512vl"), __min_vector_width__(128)))
33#define __DEFAULT_FN_ATTRS256 __attribute__((__always_inline__, __nodebug__, __target__("avx512ifma,avx512vl"), __min_vector_width__(256)))
34
35
36
37static __inline__ __m128i __DEFAULT_FN_ATTRS128
38_mm_madd52hi_epu64 (__m128i __X__m128i __Y__m128i __Z)
39{
40  return (__m128i)__builtin_ia32_vpmadd52huq128((__v2di__X, (__v2di__Y,
41                                                (__v2di__Z);
42}
43
44static __inline__ __m128i __DEFAULT_FN_ATTRS128
45_mm_mask_madd52hi_epu64 (__m128i __W__mmask8 __M__m128i __X__m128i __Y)
46{
47  return (__m128i)__builtin_ia32_selectq_128(__M,
48                                      (__v2di)_mm_madd52hi_epu64(__W__X__Y),
49                                      (__v2di)__W);
50}
51
52static __inline__ __m128i __DEFAULT_FN_ATTRS128
53_mm_maskz_madd52hi_epu64 (__mmask8 __M__m128i __X__m128i __Y__m128i __Z)
54{
55  return (__m128i)__builtin_ia32_selectq_128(__M,
56                                      (__v2di)_mm_madd52hi_epu64(__X__Y__Z),
57                                      (__v2di)_mm_setzero_si128());
58}
59
60static __inline__ __m256i __DEFAULT_FN_ATTRS256
61_mm256_madd52hi_epu64 (__m256i __X__m256i __Y__m256i __Z)
62{
63  return (__m256i)__builtin_ia32_vpmadd52huq256((__v4di)__X, (__v4di)__Y,
64                                                (__v4di)__Z);
65}
66
67static __inline__ __m256i __DEFAULT_FN_ATTRS256
68_mm256_mask_madd52hi_epu64 (__m256i __W__mmask8 __M__m256i __X__m256i __Y)
69{
70  return (__m256i)__builtin_ia32_selectq_256(__M,
71                                   (__v4di)_mm256_madd52hi_epu64(__W__X__Y),
72                                   (__v4di)__W);
73}
74
75static __inline__ __m256i __DEFAULT_FN_ATTRS256
76_mm256_maskz_madd52hi_epu64 (__mmask8 __M__m256i __X__m256i __Y__m256i __Z)
77{
78  return (__m256i)__builtin_ia32_selectq_256(__M,
79                                   (__v4di)_mm256_madd52hi_epu64(__X__Y__Z),
80                                   (__v4di)_mm256_setzero_si256());
81}
82
83static __inline__ __m128i __DEFAULT_FN_ATTRS128
84_mm_madd52lo_epu64 (__m128i __X__m128i __Y__m128i __Z)
85{
86  return (__m128i)__builtin_ia32_vpmadd52luq128((__v2di)__X, (__v2di)__Y,
87                                                (__v2di)__Z);
88}
89
90static __inline__ __m128i __DEFAULT_FN_ATTRS128
91_mm_mask_madd52lo_epu64 (__m128i __W__mmask8 __M__m128i __X__m128i __Y)
92{
93  return (__m128i)__builtin_ia32_selectq_128(__M,
94                                      (__v2di)_mm_madd52lo_epu64(__W__X__Y),
95                                      (__v2di)__W);
96}
97
98static __inline__ __m128i __DEFAULT_FN_ATTRS128
99_mm_maskz_madd52lo_epu64 (__mmask8 __M__m128i __X__m128i __Y__m128i __Z)
100{
101  return (__m128i)__builtin_ia32_selectq_128(__M,
102                                      (__v2di)_mm_madd52lo_epu64(__X__Y__Z),
103                                      (__v2di)_mm_setzero_si128());
104}
105
106static __inline__ __m256i __DEFAULT_FN_ATTRS256
107_mm256_madd52lo_epu64 (__m256i __X__m256i __Y__m256i __Z)
108{
109  return (__m256i)__builtin_ia32_vpmadd52luq256((__v4di)__X, (__v4di)__Y,
110                                                (__v4di)__Z);
111}
112
113static __inline__ __m256i __DEFAULT_FN_ATTRS256
114_mm256_mask_madd52lo_epu64 (__m256i __W__mmask8 __M__m256i __X__m256i __Y)
115{
116  return (__m256i)__builtin_ia32_selectq_256(__M,
117                                   (__v4di)_mm256_madd52lo_epu64(__W__X__Y),
118                                   (__v4di)__W);
119}
120
121static __inline__ __m256i __DEFAULT_FN_ATTRS256
122_mm256_maskz_madd52lo_epu64 (__mmask8 __M__m256i __X__m256i __Y__m256i __Z)
123{
124  return (__m256i)__builtin_ia32_selectq_256(__M,
125                                   (__v4di)_mm256_madd52lo_epu64(__X__Y__Z),
126                                   (__v4di)_mm256_setzero_si256());
127}
128
129
130#undef __DEFAULT_FN_ATTRS128
131#undef __DEFAULT_FN_ATTRS256
132
133#endif
134