avx512vnniintrin.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. /*===------------- avx512vnniintrin.h - VNNI 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 <avx512vnniintrin.h> directly; include <immintrin.h> instead."
  26. #endif
  27. #ifndef __AVX512VNNIINTRIN_H
  28. #define __AVX512VNNIINTRIN_H
  29. /* Define the default attributes for the functions in this file. */
  30. #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__, __target__("avx512vnni")))
  31. static __inline__ __m512i __DEFAULT_FN_ATTRS
  32. _mm512_mask_dpbusd_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B)
  33. {
  34. return (__m512i) __builtin_ia32_vpdpbusd512_mask ((__v16si) __S,
  35. (__v16si) __A,
  36. (__v16si) __B,
  37. (__mmask16) __U);
  38. }
  39. static __inline__ __m512i __DEFAULT_FN_ATTRS
  40. _mm512_maskz_dpbusd_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)
  41. {
  42. return (__m512i) __builtin_ia32_vpdpbusd512_maskz ((__v16si) __S,
  43. (__v16si) __A,
  44. (__v16si) __B,
  45. (__mmask16) __U);
  46. }
  47. static __inline__ __m512i __DEFAULT_FN_ATTRS
  48. _mm512_dpbusd_epi32(__m512i __S, __m512i __A, __m512i __B)
  49. {
  50. return (__m512i) __builtin_ia32_vpdpbusd512_mask ((__v16si) __S,
  51. (__v16si) __A,
  52. (__v16si) __B,
  53. (__mmask16) -1);
  54. }
  55. static __inline__ __m512i __DEFAULT_FN_ATTRS
  56. _mm512_mask_dpbusds_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B)
  57. {
  58. return (__m512i) __builtin_ia32_vpdpbusds512_mask ((__v16si) __S,
  59. (__v16si) __A,
  60. (__v16si) __B,
  61. (__mmask16) __U);
  62. }
  63. static __inline__ __m512i __DEFAULT_FN_ATTRS
  64. _mm512_maskz_dpbusds_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)
  65. {
  66. return (__m512i) __builtin_ia32_vpdpbusds512_maskz ((__v16si) __S,
  67. (__v16si) __A,
  68. (__v16si) __B,
  69. (__mmask16) __U);
  70. }
  71. static __inline__ __m512i __DEFAULT_FN_ATTRS
  72. _mm512_dpbusds_epi32(__m512i __S, __m512i __A, __m512i __B)
  73. {
  74. return (__m512i) __builtin_ia32_vpdpbusds512_mask ((__v16si) __S,
  75. (__v16si) __A,
  76. (__v16si) __B,
  77. (__mmask16) -1);
  78. }
  79. static __inline__ __m512i __DEFAULT_FN_ATTRS
  80. _mm512_mask_dpwssd_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B)
  81. {
  82. return (__m512i) __builtin_ia32_vpdpwssd512_mask ((__v16si) __S,
  83. (__v16si) __A,
  84. (__v16si) __B,
  85. (__mmask16) __U);
  86. }
  87. static __inline__ __m512i __DEFAULT_FN_ATTRS
  88. _mm512_maskz_dpwssd_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)
  89. {
  90. return (__m512i) __builtin_ia32_vpdpwssd512_maskz ((__v16si) __S,
  91. (__v16si) __A,
  92. (__v16si) __B,
  93. (__mmask16) __U);
  94. }
  95. static __inline__ __m512i __DEFAULT_FN_ATTRS
  96. _mm512_dpwssd_epi32(__m512i __S, __m512i __A, __m512i __B)
  97. {
  98. return (__m512i) __builtin_ia32_vpdpwssd512_mask ((__v16si) __S,
  99. (__v16si) __A,
  100. (__v16si) __B,
  101. (__mmask16) -1);
  102. }
  103. static __inline__ __m512i __DEFAULT_FN_ATTRS
  104. _mm512_mask_dpwssds_epi32(__m512i __S, __mmask16 __U, __m512i __A, __m512i __B)
  105. {
  106. return (__m512i) __builtin_ia32_vpdpwssds512_mask ((__v16si) __S,
  107. (__v16si) __A,
  108. (__v16si) __B,
  109. (__mmask16) __U);
  110. }
  111. static __inline__ __m512i __DEFAULT_FN_ATTRS
  112. _mm512_maskz_dpwssds_epi32(__mmask16 __U, __m512i __S, __m512i __A, __m512i __B)
  113. {
  114. return (__m512i) __builtin_ia32_vpdpwssds512_maskz ((__v16si) __S,
  115. (__v16si) __A,
  116. (__v16si) __B,
  117. (__mmask16) __U);
  118. }
  119. static __inline__ __m512i __DEFAULT_FN_ATTRS
  120. _mm512_dpwssds_epi32(__m512i __S, __m512i __A, __m512i __B)
  121. {
  122. return (__m512i) __builtin_ia32_vpdpwssds512_mask ((__v16si) __S,
  123. (__v16si) __A,
  124. (__v16si) __B,
  125. (__mmask16) -1);
  126. }
  127. #undef __DEFAULT_FN_ATTRS
  128. #endif