avx512vpopcntdqintrin.h 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. /* Copyright (C) 2017-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. #if !defined _IMMINTRIN_H_INCLUDED
  19. # error "Never use <avx512vpopcntdqintrin.h> directly; include <x86intrin.h> instead."
  20. #endif
  21. #ifndef _AVX512VPOPCNTDQINTRIN_H_INCLUDED
  22. #define _AVX512VPOPCNTDQINTRIN_H_INCLUDED
  23. #ifndef __AVX512VPOPCNTDQ__
  24. #pragma GCC push_options
  25. #pragma GCC target("avx512vpopcntdq")
  26. #define __DISABLE_AVX512VPOPCNTDQ__
  27. #endif /* __AVX512VPOPCNTDQ__ */
  28. extern __inline __m512i
  29. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  30. _mm512_popcnt_epi32 (__m512i __A)
  31. {
  32. return (__m512i) __builtin_ia32_vpopcountd_v16si ((__v16si) __A);
  33. }
  34. extern __inline __m512i
  35. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  36. _mm512_mask_popcnt_epi32 (__m512i __W, __mmask16 __U, __m512i __A)
  37. {
  38. return (__m512i) __builtin_ia32_vpopcountd_v16si_mask ((__v16si) __A,
  39. (__v16si) __W,
  40. (__mmask16) __U);
  41. }
  42. extern __inline __m512i
  43. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  44. _mm512_maskz_popcnt_epi32 (__mmask16 __U, __m512i __A)
  45. {
  46. return (__m512i) __builtin_ia32_vpopcountd_v16si_mask ((__v16si) __A,
  47. (__v16si)
  48. _mm512_setzero_si512 (),
  49. (__mmask16) __U);
  50. }
  51. extern __inline __m512i
  52. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  53. _mm512_popcnt_epi64 (__m512i __A)
  54. {
  55. return (__m512i) __builtin_ia32_vpopcountq_v8di ((__v8di) __A);
  56. }
  57. extern __inline __m512i
  58. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  59. _mm512_mask_popcnt_epi64 (__m512i __W, __mmask8 __U, __m512i __A)
  60. {
  61. return (__m512i) __builtin_ia32_vpopcountq_v8di_mask ((__v8di) __A,
  62. (__v8di) __W,
  63. (__mmask8) __U);
  64. }
  65. extern __inline __m512i
  66. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  67. _mm512_maskz_popcnt_epi64 (__mmask8 __U, __m512i __A)
  68. {
  69. return (__m512i) __builtin_ia32_vpopcountq_v8di_mask ((__v8di) __A,
  70. (__v8di)
  71. _mm512_setzero_si512 (),
  72. (__mmask8) __U);
  73. }
  74. #ifdef __DISABLE_AVX512VPOPCNTDQ__
  75. #undef __DISABLE_AVX512VPOPCNTDQ__
  76. #pragma GCC pop_options
  77. #endif /* __DISABLE_AVX512VPOPCNTDQ__ */
  78. #endif /* _AVX512VPOPCNTDQINTRIN_H_INCLUDED */