Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
14 | pmbaty | 1 | /*===------------- avx512vnniintrin.h - VNNI 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 <avx512vnniintrin.h> directly; include <immintrin.h> instead." |
||
12 | #endif |
||
13 | |||
14 | #ifndef __AVX512VNNIINTRIN_H |
||
15 | #define __AVX512VNNIINTRIN_H |
||
16 | |||
17 | /* Define the default attributes for the functions in this file. */ |
||
18 | #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vnni"), __min_vector_width__(512))) |
||
19 | |||
20 | |||
21 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
22 | _mm512_dpbusd_epi32(__m512i __S, __m512i __A, __m512i __B) |
||
23 | { |
||
24 | return (__m512i)__builtin_ia32_vpdpbusd512((__v16si)__S, (__v16si)__A, |
||
25 | (__v16si)__B); |
||
26 | } |
||
27 | |||
28 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
29 | _mm512_mask_dpbusd_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B) |
||
30 | { |
||
31 | return (__m512i)__builtin_ia32_selectd_512(__U, |
||
32 | (__v16si)_mm512_dpbusd_epi32(__S, __A, __B), |
||
33 | (__v16si)__S); |
||
34 | } |
||
35 | |||
36 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
37 | _mm512_maskz_dpbusd_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B) |
||
38 | { |
||
39 | return (__m512i)__builtin_ia32_selectd_512(__U, |
||
40 | (__v16si)_mm512_dpbusd_epi32(__S, __A, __B), |
||
41 | (__v16si)_mm512_setzero_si512()); |
||
42 | } |
||
43 | |||
44 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
45 | _mm512_dpbusds_epi32(__m512i __S, __m512i __A, __m512i __B) |
||
46 | { |
||
47 | return (__m512i)__builtin_ia32_vpdpbusds512((__v16si)__S, (__v16si)__A, |
||
48 | (__v16si)__B); |
||
49 | } |
||
50 | |||
51 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
52 | _mm512_mask_dpbusds_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B) |
||
53 | { |
||
54 | return (__m512i)__builtin_ia32_selectd_512(__U, |
||
55 | (__v16si)_mm512_dpbusds_epi32(__S, __A, __B), |
||
56 | (__v16si)__S); |
||
57 | } |
||
58 | |||
59 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
60 | _mm512_maskz_dpbusds_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B) |
||
61 | { |
||
62 | return (__m512i)__builtin_ia32_selectd_512(__U, |
||
63 | (__v16si)_mm512_dpbusds_epi32(__S, __A, __B), |
||
64 | (__v16si)_mm512_setzero_si512()); |
||
65 | } |
||
66 | |||
67 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
68 | _mm512_dpwssd_epi32(__m512i __S, __m512i __A, __m512i __B) |
||
69 | { |
||
70 | return (__m512i)__builtin_ia32_vpdpwssd512((__v16si)__S, (__v16si)__A, |
||
71 | (__v16si)__B); |
||
72 | } |
||
73 | |||
74 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
75 | _mm512_mask_dpwssd_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B) |
||
76 | { |
||
77 | return (__m512i)__builtin_ia32_selectd_512(__U, |
||
78 | (__v16si)_mm512_dpwssd_epi32(__S, __A, __B), |
||
79 | (__v16si)__S); |
||
80 | } |
||
81 | |||
82 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
83 | _mm512_maskz_dpwssd_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B) |
||
84 | { |
||
85 | return (__m512i)__builtin_ia32_selectd_512(__U, |
||
86 | (__v16si)_mm512_dpwssd_epi32(__S, __A, __B), |
||
87 | (__v16si)_mm512_setzero_si512()); |
||
88 | } |
||
89 | |||
90 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
91 | _mm512_dpwssds_epi32(__m512i __S, __m512i __A, __m512i __B) |
||
92 | { |
||
93 | return (__m512i)__builtin_ia32_vpdpwssds512((__v16si)__S, (__v16si)__A, |
||
94 | (__v16si)__B); |
||
95 | } |
||
96 | |||
97 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
98 | _mm512_mask_dpwssds_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B) |
||
99 | { |
||
100 | return (__m512i)__builtin_ia32_selectd_512(__U, |
||
101 | (__v16si)_mm512_dpwssds_epi32(__S, __A, __B), |
||
102 | (__v16si)__S); |
||
103 | } |
||
104 | |||
105 | static __inline__ __m512i __DEFAULT_FN_ATTRS |
||
106 | _mm512_maskz_dpwssds_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B) |
||
107 | { |
||
108 | return (__m512i)__builtin_ia32_selectd_512(__U, |
||
109 | (__v16si)_mm512_dpwssds_epi32(__S, __A, __B), |
||
110 | (__v16si)_mm512_setzero_si512()); |
||
111 | } |
||
112 | |||
113 | #undef __DEFAULT_FN_ATTRS |
||
114 | |||
115 | #endif |