avxvnniintrin.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. /* Copyright (C) 2020-2022 Free Software Foundation, Inc.
  2. This file is part of GCC.
  3. GCC is free software; you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation; either version 3, or (at your option)
  6. any later version.
  7. GCC is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. Under Section 7 of GPL version 3, you are granted additional
  12. permissions described in the GCC Runtime Library Exception, version
  13. 3.1, as published by the Free Software Foundation.
  14. You should have received a copy of the GNU General Public License and
  15. a copy of the GCC Runtime Library Exception along with this program;
  16. see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
  17. <http://www.gnu.org/licenses/>. */
  18. #ifndef _IMMINTRIN_H_INCLUDED
  19. #error "Never use <avxvnniintrin.h> directly; include <immintrin.h> instead."
  20. #endif
  21. #ifndef _AVXVNNIINTRIN_H_INCLUDED
  22. #define _AVXVNNIINTRIN_H_INCLUDED
  23. #if !defined(__AVXVNNI__)
  24. #pragma GCC push_options
  25. #pragma GCC target("avxvnni")
  26. #define __DISABLE_AVXVNNIVL__
  27. #endif /* __AVXVNNIVL__ */
  28. extern __inline __m256i
  29. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  30. _mm256_dpbusd_avx_epi32(__m256i __A, __m256i __B, __m256i __C)
  31. {
  32. return (__m256i) __builtin_ia32_vpdpbusd_v8si ((__v8si) __A,
  33. (__v8si) __B,
  34. (__v8si) __C);
  35. }
  36. extern __inline __m128i
  37. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  38. _mm_dpbusd_avx_epi32(__m128i __A, __m128i __B, __m128i __C)
  39. {
  40. return (__m128i) __builtin_ia32_vpdpbusd_v4si ((__v4si) __A,
  41. (__v4si) __B,
  42. (__v4si) __C);
  43. }
  44. extern __inline __m256i
  45. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  46. _mm256_dpbusds_avx_epi32(__m256i __A, __m256i __B, __m256i __C)
  47. {
  48. return (__m256i) __builtin_ia32_vpdpbusds_v8si ((__v8si) __A,
  49. (__v8si) __B,
  50. (__v8si) __C);
  51. }
  52. extern __inline __m128i
  53. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  54. _mm_dpbusds_avx_epi32(__m128i __A,__m128i __B,__m128i __C)
  55. {
  56. return (__m128i) __builtin_ia32_vpdpbusds_v4si ((__v4si) __A,
  57. (__v4si) __B,
  58. (__v4si) __C);
  59. }
  60. extern __inline __m256i
  61. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  62. _mm256_dpwssd_avx_epi32(__m256i __A,__m256i __B,__m256i __C)
  63. {
  64. return (__m256i) __builtin_ia32_vpdpwssd_v8si ((__v8si) __A,
  65. (__v8si) __B,
  66. (__v8si) __C);
  67. }
  68. extern __inline __m128i
  69. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  70. _mm_dpwssd_avx_epi32(__m128i __A,__m128i __B,__m128i __C)
  71. {
  72. return (__m128i) __builtin_ia32_vpdpwssd_v4si ((__v4si) __A,
  73. (__v4si) __B,
  74. (__v4si) __C);
  75. }
  76. extern __inline __m256i
  77. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  78. _mm256_dpwssds_avx_epi32(__m256i __A,__m256i __B,__m256i __C)
  79. {
  80. return (__m256i) __builtin_ia32_vpdpwssds_v8si ((__v8si) __A,
  81. (__v8si) __B,
  82. (__v8si) __C);
  83. }
  84. extern __inline __m128i
  85. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  86. _mm_dpwssds_avx_epi32(__m128i __A,__m128i __B,__m128i __C)
  87. {
  88. return (__m128i) __builtin_ia32_vpdpwssds_v4si ((__v4si) __A,
  89. (__v4si) __B,
  90. (__v4si) __C);
  91. }
  92. #ifdef __DISABLE_AVXVNNIVL__
  93. #undef __DISABLE_AVXVNNIVL__
  94. #pragma GCC pop_options
  95. #endif /* __DISABLE_AVXVNNIVL__ */
  96. #endif /* _AVXVNNIINTRIN_H_INCLUDED */