avx512ifmavlintrin.h 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164
  1. /* Copyright (C) 2013-2019 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 <avx512ifmavlintrin.h> directly; include <immintrin.h> instead."
  20. #endif
  21. #ifndef _AVX512IFMAVLINTRIN_H_INCLUDED
  22. #define _AVX512IFMAVLINTRIN_H_INCLUDED
  23. #if !defined(__AVX512VL__) || !defined(__AVX512IFMA__)
  24. #pragma GCC push_options
  25. #pragma GCC target("avx512ifma,avx512vl")
  26. #define __DISABLE_AVX512IFMAVL__
  27. #endif /* __AVX512IFMAVL__ */
  28. extern __inline __m128i
  29. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  30. _mm_madd52lo_epu64 (__m128i __X, __m128i __Y, __m128i __Z)
  31. {
  32. return (__m128i) __builtin_ia32_vpmadd52luq128_mask ((__v2di) __X,
  33. (__v2di) __Y,
  34. (__v2di) __Z,
  35. (__mmask8) -1);
  36. }
  37. extern __inline __m128i
  38. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  39. _mm_madd52hi_epu64 (__m128i __X, __m128i __Y, __m128i __Z)
  40. {
  41. return (__m128i) __builtin_ia32_vpmadd52huq128_mask ((__v2di) __X,
  42. (__v2di) __Y,
  43. (__v2di) __Z,
  44. (__mmask8) -1);
  45. }
  46. extern __inline __m256i
  47. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  48. _mm256_madd52lo_epu64 (__m256i __X, __m256i __Y, __m256i __Z)
  49. {
  50. return (__m256i) __builtin_ia32_vpmadd52luq256_mask ((__v4di) __X,
  51. (__v4di) __Y,
  52. (__v4di) __Z,
  53. (__mmask8) -1);
  54. }
  55. extern __inline __m256i
  56. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  57. _mm256_madd52hi_epu64 (__m256i __X, __m256i __Y, __m256i __Z)
  58. {
  59. return (__m256i) __builtin_ia32_vpmadd52huq256_mask ((__v4di) __X,
  60. (__v4di) __Y,
  61. (__v4di) __Z,
  62. (__mmask8) -1);
  63. }
  64. extern __inline __m128i
  65. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  66. _mm_mask_madd52lo_epu64 (__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y)
  67. {
  68. return (__m128i) __builtin_ia32_vpmadd52luq128_mask ((__v2di) __W,
  69. (__v2di) __X,
  70. (__v2di) __Y,
  71. (__mmask8) __M);
  72. }
  73. extern __inline __m128i
  74. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  75. _mm_mask_madd52hi_epu64 (__m128i __W, __mmask8 __M, __m128i __X, __m128i __Y)
  76. {
  77. return (__m128i) __builtin_ia32_vpmadd52huq128_mask ((__v2di) __W,
  78. (__v2di) __X,
  79. (__v2di) __Y,
  80. (__mmask8) __M);
  81. }
  82. extern __inline __m256i
  83. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  84. _mm256_mask_madd52lo_epu64 (__m256i __W, __mmask8 __M, __m256i __X,
  85. __m256i __Y)
  86. {
  87. return (__m256i) __builtin_ia32_vpmadd52luq256_mask ((__v4di) __W,
  88. (__v4di) __X,
  89. (__v4di) __Y,
  90. (__mmask8) __M);
  91. }
  92. extern __inline __m256i
  93. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  94. _mm256_mask_madd52hi_epu64 (__m256i __W, __mmask8 __M, __m256i __X,
  95. __m256i __Y)
  96. {
  97. return (__m256i) __builtin_ia32_vpmadd52huq256_mask ((__v4di) __W,
  98. (__v4di) __X,
  99. (__v4di) __Y,
  100. (__mmask8) __M);
  101. }
  102. extern __inline __m128i
  103. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  104. _mm_maskz_madd52lo_epu64 (__mmask8 __M, __m128i __X, __m128i __Y, __m128i __Z)
  105. {
  106. return (__m128i) __builtin_ia32_vpmadd52luq128_maskz ((__v2di) __X,
  107. (__v2di) __Y,
  108. (__v2di) __Z,
  109. (__mmask8) __M);
  110. }
  111. extern __inline __m128i
  112. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  113. _mm_maskz_madd52hi_epu64 (__mmask8 __M, __m128i __X, __m128i __Y, __m128i __Z)
  114. {
  115. return (__m128i) __builtin_ia32_vpmadd52huq128_maskz ((__v2di) __X,
  116. (__v2di) __Y,
  117. (__v2di) __Z,
  118. (__mmask8) __M);
  119. }
  120. extern __inline __m256i
  121. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  122. _mm256_maskz_madd52lo_epu64 (__mmask8 __M, __m256i __X, __m256i __Y, __m256i __Z)
  123. {
  124. return (__m256i) __builtin_ia32_vpmadd52luq256_maskz ((__v4di) __X,
  125. (__v4di) __Y,
  126. (__v4di) __Z,
  127. (__mmask8) __M);
  128. }
  129. extern __inline __m256i
  130. __attribute__ ((__gnu_inline__, __always_inline__, __artificial__))
  131. _mm256_maskz_madd52hi_epu64 (__mmask8 __M, __m256i __X, __m256i __Y, __m256i __Z)
  132. {
  133. return (__m256i) __builtin_ia32_vpmadd52huq256_maskz ((__v4di) __X,
  134. (__v4di) __Y,
  135. (__v4di) __Z,
  136. (__mmask8) __M);
  137. }
  138. #ifdef __DISABLE_AVX512IFMAVL__
  139. #undef __DISABLE_AVX512IFMAVL__
  140. #pragma GCC pop_options
  141. #endif /* __DISABLE_AVX512IFMAVL__ */
  142. #endif /* _AVX512IFMAVLINTRIN_H_INCLUDED */