1 /*===---- adxintrin.h - ADX intrinsics -------------------------------------===
3 * Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 * See https://llvm.org/LICENSE.txt for license information.
5 * SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 *===-----------------------------------------------------------------------===
11 #error "Never use <adxintrin.h> directly; include <immintrin.h> instead."
17 /* Define the default attributes for the functions in this file. */
18 #define __DEFAULT_FN_ATTRS __attribute__((__always_inline__, __nodebug__))
20 /* Intrinsics that are available only if __ADX__ defined */
21 static __inline
unsigned char __attribute__((__always_inline__
, __nodebug__
, __target__("adx")))
22 _addcarryx_u32(unsigned char __cf
, unsigned int __x
, unsigned int __y
,
25 return __builtin_ia32_addcarryx_u32(__cf
, __x
, __y
, __p
);
29 static __inline
unsigned char __attribute__((__always_inline__
, __nodebug__
, __target__("adx")))
30 _addcarryx_u64(unsigned char __cf
, unsigned long long __x
,
31 unsigned long long __y
, unsigned long long *__p
)
33 return __builtin_ia32_addcarryx_u64(__cf
, __x
, __y
, __p
);
37 /* Intrinsics that are also available if __ADX__ undefined */
38 static __inline
unsigned char __DEFAULT_FN_ATTRS
39 _addcarry_u32(unsigned char __cf
, unsigned int __x
, unsigned int __y
,
42 return __builtin_ia32_addcarryx_u32(__cf
, __x
, __y
, __p
);
46 static __inline
unsigned char __DEFAULT_FN_ATTRS
47 _addcarry_u64(unsigned char __cf
, unsigned long long __x
,
48 unsigned long long __y
, unsigned long long *__p
)
50 return __builtin_ia32_addcarryx_u64(__cf
, __x
, __y
, __p
);
54 static __inline
unsigned char __DEFAULT_FN_ATTRS
55 _subborrow_u32(unsigned char __cf
, unsigned int __x
, unsigned int __y
,
58 return __builtin_ia32_subborrow_u32(__cf
, __x
, __y
, __p
);
62 static __inline
unsigned char __DEFAULT_FN_ATTRS
63 _subborrow_u64(unsigned char __cf
, unsigned long long __x
,
64 unsigned long long __y
, unsigned long long *__p
)
66 return __builtin_ia32_subborrow_u64(__cf
, __x
, __y
, __p
);
70 #undef __DEFAULT_FN_ATTRS
72 #endif /* __ADXINTRIN_H */