clang API Documentation

adxintrin.h
Go to the documentation of this file.
00001 /*===---- adxintrin.h - ADX intrinsics -------------------------------------===
00002  *
00003  * Permission is hereby granted, free of charge, to any person obtaining a copy
00004  * of this software and associated documentation files (the "Software"), to deal
00005  * in the Software without restriction, including without limitation the rights
00006  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00007  * copies of the Software, and to permit persons to whom the Software is
00008  * furnished to do so, subject to the following conditions:
00009  *
00010  * The above copyright notice and this permission notice shall be included in
00011  * all copies or substantial portions of the Software.
00012  *
00013  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00014  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00015  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00016  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00017  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00018  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00019  * THE SOFTWARE.
00020  *
00021  *===-----------------------------------------------------------------------===
00022  */
00023 
00024 #ifndef __IMMINTRIN_H
00025 #error "Never use <adxintrin.h> directly; include <immintrin.h> instead."
00026 #endif
00027 
00028 #ifndef __ADXINTRIN_H
00029 #define __ADXINTRIN_H
00030 
00031 /* Intrinsics that are available only if __ADX__ defined */
00032 #ifdef __ADX__
00033 static __inline unsigned char __attribute__((__always_inline__, __nodebug__))
00034 _addcarryx_u32(unsigned char __cf, unsigned int __x, unsigned int __y,
00035                unsigned int *__p)
00036 {
00037   return __builtin_ia32_addcarryx_u32(__cf, __x, __y, __p);
00038 }
00039 
00040 #ifdef __x86_64__
00041 static __inline unsigned char __attribute__((__always_inline__, __nodebug__))
00042 _addcarryx_u64(unsigned char __cf, unsigned long long __x,
00043                unsigned long long __y, unsigned long long  *__p)
00044 {
00045   return __builtin_ia32_addcarryx_u64(__cf, __x, __y, __p);
00046 }
00047 #endif
00048 #endif
00049 
00050 /* Intrinsics that are also available if __ADX__ undefined */
00051 static __inline unsigned char __attribute__((__always_inline__, __nodebug__))
00052 _addcarry_u32(unsigned char __cf, unsigned int __x, unsigned int __y,
00053               unsigned int *__p)
00054 {
00055   return __builtin_ia32_addcarry_u32(__cf, __x, __y, __p);
00056 }
00057 
00058 #ifdef __x86_64__
00059 static __inline unsigned char __attribute__((__always_inline__, __nodebug__))
00060 _addcarry_u64(unsigned char __cf, unsigned long long __x,
00061               unsigned long long __y, unsigned long long  *__p)
00062 {
00063   return __builtin_ia32_addcarry_u64(__cf, __x, __y, __p);
00064 }
00065 #endif
00066 
00067 static __inline unsigned char __attribute__((__always_inline__, __nodebug__))
00068 _subborrow_u32(unsigned char __cf, unsigned int __x, unsigned int __y,
00069               unsigned int *__p)
00070 {
00071   return __builtin_ia32_subborrow_u32(__cf, __x, __y, __p);
00072 }
00073 
00074 #ifdef __x86_64__
00075 static __inline unsigned char __attribute__((__always_inline__, __nodebug__))
00076 _subborrow_u64(unsigned char __cf, unsigned long long __x,
00077                unsigned long long __y, unsigned long long  *__p)
00078 {
00079   return __builtin_ia32_subborrow_u64(__cf, __x, __y, __p);
00080 }
00081 #endif
00082 
00083 #endif /* __ADXINTRIN_H */