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 \
19 __attribute__((__always_inline__, __nodebug__, __target__("adx")))
21 /* Use C++ inline semantics in C++, GNU inline for C mode. */
22 #if defined(__cplusplus)
23 #define __INLINE __inline
25 #define __INLINE static __inline
28 #if defined(__cplusplus)
32 /* Intrinsics that are available only if __ADX__ is defined. */
34 /// Adds unsigned 32-bit integers \a __x and \a __y, plus 0 or 1 as indicated
35 /// by the carry flag \a __cf. Stores the unsigned 32-bit sum in the memory
36 /// at \a __p, and returns the 8-bit carry-out (carry flag).
39 /// temp := (__cf == 0) ? 0 : 1
40 /// Store32(__p, __x + __y + temp)
44 /// \headerfile <immintrin.h>
46 /// This intrinsic corresponds to the \c ADCX instruction.
49 /// The 8-bit unsigned carry flag; any non-zero value indicates carry.
51 /// A 32-bit unsigned addend.
53 /// A 32-bit unsigned addend.
55 /// Pointer to memory for storing the sum.
56 /// \returns The 8-bit unsigned carry-out value.
57 __INLINE
unsigned char __DEFAULT_FN_ATTRS
_addcarryx_u32(unsigned char __cf
,
61 return __builtin_ia32_addcarryx_u32(__cf
, __x
, __y
, __p
);
65 /// Adds unsigned 64-bit integers \a __x and \a __y, plus 0 or 1 as indicated
66 /// by the carry flag \a __cf. Stores the unsigned 64-bit sum in the memory
67 /// at \a __p, and returns the 8-bit carry-out (carry flag).
70 /// temp := (__cf == 0) ? 0 : 1
71 /// Store64(__p, __x + __y + temp)
75 /// \headerfile <immintrin.h>
77 /// This intrinsic corresponds to the \c ADCX instruction.
80 /// The 8-bit unsigned carry flag; any non-zero value indicates carry.
82 /// A 64-bit unsigned addend.
84 /// A 64-bit unsigned addend.
86 /// Pointer to memory for storing the sum.
87 /// \returns The 8-bit unsigned carry-out value.
88 __INLINE
unsigned char __DEFAULT_FN_ATTRS
89 _addcarryx_u64(unsigned char __cf
, unsigned long long __x
,
90 unsigned long long __y
, unsigned long long *__p
) {
91 return __builtin_ia32_addcarryx_u64(__cf
, __x
, __y
, __p
);
95 #if defined(__cplusplus)
100 #undef __DEFAULT_FN_ATTRS
102 #endif /* __ADXINTRIN_H */