adxintrin.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* Copyright (C) 2012-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 <adxintrin.h> directly; include <immintrin.h> instead."
  20. #endif
  21. #ifndef _ADXINTRIN_H_INCLUDED
  22. #define _ADXINTRIN_H_INCLUDED
  23. extern __inline unsigned char
  24. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  25. _subborrow_u32 (unsigned char __CF, unsigned int __X,
  26. unsigned int __Y, unsigned int *__P)
  27. {
  28. return __builtin_ia32_sbb_u32 (__CF, __X, __Y, __P);
  29. }
  30. extern __inline unsigned char
  31. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  32. _addcarry_u32 (unsigned char __CF, unsigned int __X,
  33. unsigned int __Y, unsigned int *__P)
  34. {
  35. return __builtin_ia32_addcarryx_u32 (__CF, __X, __Y, __P);
  36. }
  37. extern __inline unsigned char
  38. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  39. _addcarryx_u32 (unsigned char __CF, unsigned int __X,
  40. unsigned int __Y, unsigned int *__P)
  41. {
  42. return __builtin_ia32_addcarryx_u32 (__CF, __X, __Y, __P);
  43. }
  44. #ifdef __x86_64__
  45. extern __inline unsigned char
  46. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  47. _subborrow_u64 (unsigned char __CF, unsigned long long __X,
  48. unsigned long long __Y, unsigned long long *__P)
  49. {
  50. return __builtin_ia32_sbb_u64 (__CF, __X, __Y, __P);
  51. }
  52. extern __inline unsigned char
  53. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  54. _addcarry_u64 (unsigned char __CF, unsigned long long __X,
  55. unsigned long long __Y, unsigned long long *__P)
  56. {
  57. return __builtin_ia32_addcarryx_u64 (__CF, __X, __Y, __P);
  58. }
  59. extern __inline unsigned char
  60. __attribute__((__gnu_inline__, __always_inline__, __artificial__))
  61. _addcarryx_u64 (unsigned char __CF, unsigned long long __X,
  62. unsigned long long __Y, unsigned long long *__P)
  63. {
  64. return __builtin_ia32_addcarryx_u64 (__CF, __X, __Y, __P);
  65. }
  66. #endif
  67. #endif /* _ADXINTRIN_H_INCLUDED */