Home | History | Annotate | Line # | Download | only in Headers
      1  1.1  joerg /*===------------- avx512vbmiintrin.h - VBMI intrinsics ------------------===
      2  1.1  joerg  *
      3  1.1  joerg  *
      4  1.1  joerg  * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
      5  1.1  joerg  * See https://llvm.org/LICENSE.txt for license information.
      6  1.1  joerg  * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
      7  1.1  joerg  *
      8  1.1  joerg  *===-----------------------------------------------------------------------===
      9  1.1  joerg  */
     10  1.1  joerg #ifndef __IMMINTRIN_H
     11  1.1  joerg #error "Never use <avx512vbmiintrin.h> directly; include <immintrin.h> instead."
     12  1.1  joerg #endif
     13  1.1  joerg 
     14  1.1  joerg #ifndef __VBMIINTRIN_H
     15  1.1  joerg #define __VBMIINTRIN_H
     16  1.1  joerg 
     17  1.1  joerg /* Define the default attributes for the functions in this file. */
     18  1.1  joerg #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vbmi"), __min_vector_width__(512)))
     19  1.1  joerg 
     20  1.1  joerg 
     21  1.1  joerg static __inline__ __m512i __DEFAULT_FN_ATTRS
     22  1.1  joerg _mm512_permutex2var_epi8(__m512i __A, __m512i __I, __m512i __B)
     23  1.1  joerg {
     24  1.1  joerg   return (__m512i)__builtin_ia32_vpermi2varqi512((__v64qi)__A, (__v64qi)__I,
     25  1.1  joerg                                                  (__v64qi) __B);
     26  1.1  joerg }
     27  1.1  joerg 
     28  1.1  joerg static __inline__ __m512i __DEFAULT_FN_ATTRS
     29  1.1  joerg _mm512_mask_permutex2var_epi8(__m512i __A, __mmask64 __U, __m512i __I,
     30  1.1  joerg                               __m512i __B)
     31  1.1  joerg {
     32  1.1  joerg   return (__m512i)__builtin_ia32_selectb_512(__U,
     33  1.1  joerg                                (__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),
     34  1.1  joerg                                (__v64qi)__A);
     35  1.1  joerg }
     36  1.1  joerg 
     37  1.1  joerg static __inline__ __m512i __DEFAULT_FN_ATTRS
     38  1.1  joerg _mm512_mask2_permutex2var_epi8(__m512i __A, __m512i __I, __mmask64 __U,
     39  1.1  joerg                                __m512i __B)
     40  1.1  joerg {
     41  1.1  joerg   return (__m512i)__builtin_ia32_selectb_512(__U,
     42  1.1  joerg                                (__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),
     43  1.1  joerg                                (__v64qi)__I);
     44  1.1  joerg }
     45  1.1  joerg 
     46  1.1  joerg static __inline__ __m512i __DEFAULT_FN_ATTRS
     47  1.1  joerg _mm512_maskz_permutex2var_epi8(__mmask64 __U, __m512i __A, __m512i __I,
     48  1.1  joerg                                __m512i __B)
     49  1.1  joerg {
     50  1.1  joerg   return (__m512i)__builtin_ia32_selectb_512(__U,
     51  1.1  joerg                                (__v64qi)_mm512_permutex2var_epi8(__A, __I, __B),
     52  1.1  joerg                                (__v64qi)_mm512_setzero_si512());
     53  1.1  joerg }
     54  1.1  joerg 
     55  1.1  joerg static __inline__ __m512i __DEFAULT_FN_ATTRS
     56  1.1  joerg _mm512_permutexvar_epi8 (__m512i __A, __m512i __B)
     57  1.1  joerg {
     58  1.1  joerg   return (__m512i)__builtin_ia32_permvarqi512((__v64qi) __B, (__v64qi) __A);
     59  1.1  joerg }
     60  1.1  joerg 
     61  1.1  joerg static __inline__ __m512i __DEFAULT_FN_ATTRS
     62  1.1  joerg _mm512_maskz_permutexvar_epi8 (__mmask64 __M, __m512i __A,
     63  1.1  joerg         __m512i __B)
     64  1.1  joerg {
     65  1.1  joerg   return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
     66  1.1  joerg                                      (__v64qi)_mm512_permutexvar_epi8(__A, __B),
     67  1.1  joerg                                      (__v64qi)_mm512_setzero_si512());
     68  1.1  joerg }
     69  1.1  joerg 
     70  1.1  joerg static __inline__ __m512i __DEFAULT_FN_ATTRS
     71  1.1  joerg _mm512_mask_permutexvar_epi8 (__m512i __W, __mmask64 __M, __m512i __A,
     72  1.1  joerg              __m512i __B)
     73  1.1  joerg {
     74  1.1  joerg   return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
     75  1.1  joerg                                      (__v64qi)_mm512_permutexvar_epi8(__A, __B),
     76  1.1  joerg                                      (__v64qi)__W);
     77  1.1  joerg }
     78  1.1  joerg 
     79  1.1  joerg static __inline__ __m512i __DEFAULT_FN_ATTRS
     80  1.1  joerg _mm512_multishift_epi64_epi8(__m512i __X, __m512i __Y)
     81  1.1  joerg {
     82  1.1  joerg   return (__m512i)__builtin_ia32_vpmultishiftqb512((__v64qi)__X, (__v64qi) __Y);
     83  1.1  joerg }
     84  1.1  joerg 
     85  1.1  joerg static __inline__ __m512i __DEFAULT_FN_ATTRS
     86  1.1  joerg _mm512_mask_multishift_epi64_epi8(__m512i __W, __mmask64 __M, __m512i __X,
     87  1.1  joerg                                   __m512i __Y)
     88  1.1  joerg {
     89  1.1  joerg   return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
     90  1.1  joerg                                 (__v64qi)_mm512_multishift_epi64_epi8(__X, __Y),
     91  1.1  joerg                                 (__v64qi)__W);
     92  1.1  joerg }
     93  1.1  joerg 
     94  1.1  joerg static __inline__ __m512i __DEFAULT_FN_ATTRS
     95  1.1  joerg _mm512_maskz_multishift_epi64_epi8(__mmask64 __M, __m512i __X, __m512i __Y)
     96  1.1  joerg {
     97  1.1  joerg   return (__m512i)__builtin_ia32_selectb_512((__mmask64)__M,
     98  1.1  joerg                                 (__v64qi)_mm512_multishift_epi64_epi8(__X, __Y),
     99  1.1  joerg                                 (__v64qi)_mm512_setzero_si512());
    100  1.1  joerg }
    101  1.1  joerg 
    102  1.1  joerg 
    103  1.1  joerg #undef __DEFAULT_FN_ATTRS
    104  1.1  joerg 
    105  1.1  joerg #endif
    106