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 /* Use C++ inline semantics in C++, GNU inline for C mode. */
21 #if defined(__cplusplus)
22 #define __INLINE __inline
24 #define __INLINE static __inline
27 #if defined(__cplusplus)
31 /* Intrinsics that are available only if __ADX__ defined */
32 __INLINE
unsigned char
33 __attribute__((__always_inline__
, __nodebug__
, __target__("adx")))
34 _addcarryx_u32(unsigned char __cf
, unsigned int __x
, unsigned int __y
,
36 return __builtin_ia32_addcarryx_u32(__cf
, __x
, __y
, __p
);
40 __INLINE
unsigned char
41 __attribute__((__always_inline__
, __nodebug__
, __target__("adx")))
42 _addcarryx_u64(unsigned char __cf
, unsigned long long __x
,
43 unsigned long long __y
, unsigned long long *__p
) {
44 return __builtin_ia32_addcarryx_u64(__cf
, __x
, __y
, __p
);
48 /* Intrinsics that are also available if __ADX__ undefined */
49 __INLINE
unsigned char __DEFAULT_FN_ATTRS
_addcarry_u32(unsigned char __cf
,
53 return __builtin_ia32_addcarryx_u32(__cf
, __x
, __y
, __p
);
57 __INLINE
unsigned char __DEFAULT_FN_ATTRS
58 _addcarry_u64(unsigned char __cf
, unsigned long long __x
,
59 unsigned long long __y
, unsigned long long *__p
) {
60 return __builtin_ia32_addcarryx_u64(__cf
, __x
, __y
, __p
);
64 __INLINE
unsigned char __DEFAULT_FN_ATTRS
_subborrow_u32(unsigned char __cf
,
68 return __builtin_ia32_subborrow_u32(__cf
, __x
, __y
, __p
);
72 __INLINE
unsigned char __DEFAULT_FN_ATTRS
73 _subborrow_u64(unsigned char __cf
, unsigned long long __x
,
74 unsigned long long __y
, unsigned long long *__p
) {
75 return __builtin_ia32_subborrow_u64(__cf
, __x
, __y
, __p
);
79 #if defined(__cplusplus)
83 #undef __DEFAULT_FN_ATTRS
85 #endif /* __ADXINTRIN_H */