[AMDGPU][AsmParser][NFC] Get rid of custom default operand handlers.
[llvm-project.git] / clang / lib / Headers / adxintrin.h
blob4382530fa6c04f6191442b3a22e0bbc12a3a4f90
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 *===-----------------------------------------------------------------------===
8 */
10 #ifndef __IMMINTRIN_H
11 #error "Never use <adxintrin.h> directly; include <immintrin.h> instead."
12 #endif
14 #ifndef __ADXINTRIN_H
15 #define __ADXINTRIN_H
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
23 #else
24 #define __INLINE static __inline
25 #endif
27 #if defined(__cplusplus)
28 extern "C" {
29 #endif
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,
35 unsigned int *__p) {
36 return __builtin_ia32_addcarryx_u32(__cf, __x, __y, __p);
39 #ifdef __x86_64__
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);
46 #endif
48 /* Intrinsics that are also available if __ADX__ undefined */
49 __INLINE unsigned char __DEFAULT_FN_ATTRS _addcarry_u32(unsigned char __cf,
50 unsigned int __x,
51 unsigned int __y,
52 unsigned int *__p) {
53 return __builtin_ia32_addcarryx_u32(__cf, __x, __y, __p);
56 #ifdef __x86_64__
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);
62 #endif
64 __INLINE unsigned char __DEFAULT_FN_ATTRS _subborrow_u32(unsigned char __cf,
65 unsigned int __x,
66 unsigned int __y,
67 unsigned int *__p) {
68 return __builtin_ia32_subborrow_u32(__cf, __x, __y, __p);
71 #ifdef __x86_64__
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);
77 #endif
79 #if defined(__cplusplus)
81 #endif
83 #undef __DEFAULT_FN_ATTRS
85 #endif /* __ADXINTRIN_H */