| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 | |
| 15 | |
| 16 | |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | |
| 22 | |
| 23 | |
| 24 | #ifndef __IMMINTRIN_H |
| 25 | #error "Never use <adxintrin.h> directly; include <immintrin.h> instead." |
| 26 | #endif |
| 27 | |
| 28 | #ifndef __ADXINTRIN_H |
| 29 | #define __ADXINTRIN_H |
| 30 | |
| 31 | |
| 32 | #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__)) |
| 33 | |
| 34 | |
| 35 | static __inline unsigned char __attribute__((__always_inline__, __nodebug__, __target__("adx"))) |
| 36 | _addcarryx_u32(unsigned char __cf, unsigned int __x, unsigned int __y, |
| 37 | unsigned int *__p) |
| 38 | { |
| 39 | return __builtin_ia32_addcarryx_u32(__cf, __x, __y, __p); |
| 40 | } |
| 41 | |
| 42 | #ifdef __x86_64__ |
| 43 | static __inline unsigned char __attribute__((__always_inline__, __nodebug__, __target__("adx"))) |
| 44 | _addcarryx_u64(unsigned char __cf, unsigned long long __x, |
| 45 | unsigned long long __y, unsigned long long *__p) |
| 46 | { |
| 47 | return __builtin_ia32_addcarryx_u64(__cf, __x, __y, __p); |
| 48 | } |
| 49 | #endif |
| 50 | |
| 51 | |
| 52 | static __inline unsigned char __DEFAULT_FN_ATTRS |
| 53 | _addcarry_u32(unsigned char __cf, unsigned int __x, unsigned int __y, |
| 54 | unsigned int *__p) |
| 55 | { |
| 56 | return __builtin_ia32_addcarryx_u32(__cf, __x, __y, __p); |
| 57 | } |
| 58 | |
| 59 | #ifdef __x86_64__ |
| 60 | static __inline unsigned char __DEFAULT_FN_ATTRS |
| 61 | _addcarry_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 | |
| 68 | static __inline unsigned char __DEFAULT_FN_ATTRS |
| 69 | _subborrow_u32(unsigned char __cf, unsigned int __x, unsigned int __y, |
| 70 | unsigned int *__p) |
| 71 | { |
| 72 | return __builtin_ia32_subborrow_u32(__cf, __x, __y, __p); |
| 73 | } |
| 74 | |
| 75 | #ifdef __x86_64__ |
| 76 | static __inline unsigned char __DEFAULT_FN_ATTRS |
| 77 | _subborrow_u64(unsigned char __cf, unsigned long long __x, |
| 78 | unsigned long long __y, unsigned long long *__p) |
| 79 | { |
| 80 | return __builtin_ia32_subborrow_u64(__cf, __x, __y, __p); |
| 81 | } |
| 82 | #endif |
| 83 | |
| 84 | #undef __DEFAULT_FN_ATTRS |
| 85 | |
| 86 | #endif |
| 87 | |