[Flang] remove whole-archive option for AIX linker (#76039)
[llvm-project.git] / clang / lib / Headers / avx512bitalgintrin.h
blobbad265ceb7db23fc1e5778d1d75e540c4f2feab7
1 /*===------------- avx512bitalgintrin.h - BITALG intrinsics ------------------===
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
8 *===-----------------------------------------------------------------------===
9 */
10 #ifndef __IMMINTRIN_H
11 #error "Never use <avx512bitalgintrin.h> directly; include <immintrin.h> instead."
12 #endif
14 #ifndef __AVX512BITALGINTRIN_H
15 #define __AVX512BITALGINTRIN_H
17 /* Define the default attributes for the functions in this file. */
18 #define __DEFAULT_FN_ATTRS \
19 __attribute__((__always_inline__, __nodebug__, \
20 __target__("avx512bitalg,evex512"), \
21 __min_vector_width__(512)))
23 static __inline__ __m512i __DEFAULT_FN_ATTRS
24 _mm512_popcnt_epi16(__m512i __A)
26 return (__m512i) __builtin_ia32_vpopcntw_512((__v32hi) __A);
29 static __inline__ __m512i __DEFAULT_FN_ATTRS
30 _mm512_mask_popcnt_epi16(__m512i __A, __mmask32 __U, __m512i __B)
32 return (__m512i) __builtin_ia32_selectw_512((__mmask32) __U,
33 (__v32hi) _mm512_popcnt_epi16(__B),
34 (__v32hi) __A);
37 static __inline__ __m512i __DEFAULT_FN_ATTRS
38 _mm512_maskz_popcnt_epi16(__mmask32 __U, __m512i __B)
40 return _mm512_mask_popcnt_epi16((__m512i) _mm512_setzero_si512(),
41 __U,
42 __B);
45 static __inline__ __m512i __DEFAULT_FN_ATTRS
46 _mm512_popcnt_epi8(__m512i __A)
48 return (__m512i) __builtin_ia32_vpopcntb_512((__v64qi) __A);
51 static __inline__ __m512i __DEFAULT_FN_ATTRS
52 _mm512_mask_popcnt_epi8(__m512i __A, __mmask64 __U, __m512i __B)
54 return (__m512i) __builtin_ia32_selectb_512((__mmask64) __U,
55 (__v64qi) _mm512_popcnt_epi8(__B),
56 (__v64qi) __A);
59 static __inline__ __m512i __DEFAULT_FN_ATTRS
60 _mm512_maskz_popcnt_epi8(__mmask64 __U, __m512i __B)
62 return _mm512_mask_popcnt_epi8((__m512i) _mm512_setzero_si512(),
63 __U,
64 __B);
67 static __inline__ __mmask64 __DEFAULT_FN_ATTRS
68 _mm512_mask_bitshuffle_epi64_mask(__mmask64 __U, __m512i __A, __m512i __B)
70 return (__mmask64) __builtin_ia32_vpshufbitqmb512_mask((__v64qi) __A,
71 (__v64qi) __B,
72 __U);
75 static __inline__ __mmask64 __DEFAULT_FN_ATTRS
76 _mm512_bitshuffle_epi64_mask(__m512i __A, __m512i __B)
78 return _mm512_mask_bitshuffle_epi64_mask((__mmask64) -1,
79 __A,
80 __B);
84 #undef __DEFAULT_FN_ATTRS
86 #endif