Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
14 | pmbaty | 1 | /*===------------- avx512cdintrin.h - AVX512CD intrinsics ------------------=== |
2 | * |
||
3 | * |
||
4 | * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
||
5 | * See https://llvm.org/LICENSE.txt for license information. |
||
6 | * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
||
7 | * |
||
8 | *===-----------------------------------------------------------------------=== |
||
9 | */ |
||
10 | #ifndef __IMMINTRIN_H |
||
11 | #error "Never use <avx512cdintrin.h> directly; include <immintrin.h> instead." |
||
12 | #endif |
||
13 | |||
14 | #ifndef __AVX512CDINTRIN_H |
||
15 | #define __AVX512CDINTRIN_H |
||
16 | |||
17 | /* Define the default attributes for the functions in this file. */ |
||
18 | #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512cd"), __min_vector_width__(512))) |
||
19 | |||
20 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
21 | _mm512_conflict_epi64 (__m512i __A) |
||
22 | { |
||
23 | return (__m512i) __builtin_ia32_vpconflictdi_512 ((__v8di) __A); |
||
24 | } |
||
25 | |||
26 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
27 | _mm512_mask_conflict_epi64 (__m512i __W, __mmask8 __U, __m512i __A) |
||
28 | { |
||
29 | return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, |
||
30 | (__v8di)_mm512_conflict_epi64(__A), |
||
31 | (__v8di)__W); |
||
32 | } |
||
33 | |||
34 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
35 | _mm512_maskz_conflict_epi64 (__mmask8 __U, __m512i __A) |
||
36 | { |
||
37 | return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, |
||
38 | (__v8di)_mm512_conflict_epi64(__A), |
||
39 | (__v8di)_mm512_setzero_si512 ()); |
||
40 | } |
||
41 | |||
42 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
43 | _mm512_conflict_epi32 (__m512i __A) |
||
44 | { |
||
45 | return (__m512i) __builtin_ia32_vpconflictsi_512 ((__v16si) __A); |
||
46 | } |
||
47 | |||
48 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
49 | _mm512_mask_conflict_epi32 (__m512i __W, __mmask16 __U, __m512i __A) |
||
50 | { |
||
51 | return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, |
||
52 | (__v16si)_mm512_conflict_epi32(__A), |
||
53 | (__v16si)__W); |
||
54 | } |
||
55 | |||
56 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
57 | _mm512_maskz_conflict_epi32 (__mmask16 __U, __m512i __A) |
||
58 | { |
||
59 | return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, |
||
60 | (__v16si)_mm512_conflict_epi32(__A), |
||
61 | (__v16si)_mm512_setzero_si512()); |
||
62 | } |
||
63 | |||
64 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
65 | _mm512_lzcnt_epi32 (__m512i __A) |
||
66 | { |
||
67 | return (__m512i) __builtin_ia32_vplzcntd_512 ((__v16si) __A); |
||
68 | } |
||
69 | |||
70 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
71 | _mm512_mask_lzcnt_epi32 (__m512i __W, __mmask16 __U, __m512i __A) |
||
72 | { |
||
73 | return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, |
||
74 | (__v16si)_mm512_lzcnt_epi32(__A), |
||
75 | (__v16si)__W); |
||
76 | } |
||
77 | |||
78 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
79 | _mm512_maskz_lzcnt_epi32 (__mmask16 __U, __m512i __A) |
||
80 | { |
||
81 | return (__m512i)__builtin_ia32_selectd_512((__mmask16)__U, |
||
82 | (__v16si)_mm512_lzcnt_epi32(__A), |
||
83 | (__v16si)_mm512_setzero_si512()); |
||
84 | } |
||
85 | |||
86 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
87 | _mm512_lzcnt_epi64 (__m512i __A) |
||
88 | { |
||
89 | return (__m512i) __builtin_ia32_vplzcntq_512 ((__v8di) __A); |
||
90 | } |
||
91 | |||
92 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
93 | _mm512_mask_lzcnt_epi64 (__m512i __W, __mmask8 __U, __m512i __A) |
||
94 | { |
||
95 | return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, |
||
96 | (__v8di)_mm512_lzcnt_epi64(__A), |
||
97 | (__v8di)__W); |
||
98 | } |
||
99 | |||
100 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
101 | _mm512_maskz_lzcnt_epi64 (__mmask8 __U, __m512i __A) |
||
102 | { |
||
103 | return (__m512i)__builtin_ia32_selectq_512((__mmask8)__U, |
||
104 | (__v8di)_mm512_lzcnt_epi64(__A), |
||
105 | (__v8di)_mm512_setzero_si512()); |
||
106 | } |
||
107 | |||
108 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
109 | _mm512_broadcastmb_epi64 (__mmask8 __A) |
||
110 | { |
||
111 | return (__m512i) _mm512_set1_epi64((long long) __A); |
||
112 | } |
||
113 | |||
114 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
115 | _mm512_broadcastmw_epi32 (__mmask16 __A) |
||
116 | { |
||
117 | return (__m512i) _mm512_set1_epi32((int) __A); |
||
118 | |||
119 | } |
||
120 | |||
121 | #undef __DEFAULT_FN_ATTRS |
||
122 | |||
123 | #endif |