Path: blob/master/tools/android-sdk/renderscript/clang-include/immintrin.h
496 views
/*===---- immintrin.h - Intel intrinsics -----------------------------------===1*2* Permission is hereby granted, free of charge, to any person obtaining a copy3* of this software and associated documentation files (the "Software"), to deal4* in the Software without restriction, including without limitation the rights5* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell6* copies of the Software, and to permit persons to whom the Software is7* furnished to do so, subject to the following conditions:8*9* The above copyright notice and this permission notice shall be included in10* all copies or substantial portions of the Software.11*12* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR13* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,14* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE15* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER16* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,17* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN18* THE SOFTWARE.19*20*===-----------------------------------------------------------------------===21*/2223#ifndef __IMMINTRIN_H24#define __IMMINTRIN_H2526#if !defined(_MSC_VER) || __has_feature(modules) || defined(__MMX__)27#include <mmintrin.h>28#endif2930#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE__)31#include <xmmintrin.h>32#endif3334#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE2__)35#include <emmintrin.h>36#endif3738#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSE3__)39#include <pmmintrin.h>40#endif4142#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SSSE3__)43#include <tmmintrin.h>44#endif4546#if !defined(_MSC_VER) || __has_feature(modules) || \47(defined(__SSE4_2__) || defined(__SSE4_1__))48#include <smmintrin.h>49#endif5051#if !defined(_MSC_VER) || __has_feature(modules) || \52(defined(__AES__) || defined(__PCLMUL__))53#include <wmmintrin.h>54#endif5556#if !defined(_MSC_VER) || __has_feature(modules) || defined(__CLFLUSHOPT__)57#include <clflushoptintrin.h>58#endif5960#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX__)61#include <avxintrin.h>62#endif6364#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX2__)65#include <avx2intrin.h>6667/* The 256-bit versions of functions in f16cintrin.h.68Intel documents these as being in immintrin.h, and69they depend on typedefs from avxintrin.h. */7071#define _mm256_cvtps_ph(a, imm) __extension__ ({ \72(__m128i)__builtin_ia32_vcvtps2ph256((__v8sf)(__m256)(a), (imm)); })7374static __inline __m256 __attribute__((__always_inline__, __nodebug__, __target__("f16c")))75_mm256_cvtph_ps(__m128i __a)76{77return (__m256)__builtin_ia32_vcvtph2ps256((__v8hi)__a);78}79#endif /* __AVX2__ */8081#if !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI__)82#include <bmiintrin.h>83#endif8485#if !defined(_MSC_VER) || __has_feature(modules) || defined(__BMI2__)86#include <bmi2intrin.h>87#endif8889#if !defined(_MSC_VER) || __has_feature(modules) || defined(__LZCNT__)90#include <lzcntintrin.h>91#endif9293#if !defined(_MSC_VER) || __has_feature(modules) || defined(__FMA__)94#include <fmaintrin.h>95#endif9697#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512F__)98#include <avx512fintrin.h>99#endif100101#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VL__)102#include <avx512vlintrin.h>103#endif104105#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512BW__)106#include <avx512bwintrin.h>107#endif108109#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512CD__)110#include <avx512cdintrin.h>111#endif112113#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512DQ__)114#include <avx512dqintrin.h>115#endif116117#if !defined(_MSC_VER) || __has_feature(modules) || \118(defined(__AVX512VL__) && defined(__AVX512BW__))119#include <avx512vlbwintrin.h>120#endif121122#if !defined(_MSC_VER) || __has_feature(modules) || \123(defined(__AVX512VL__) && defined(__AVX512CD__))124#include <avx512vlcdintrin.h>125#endif126127#if !defined(_MSC_VER) || __has_feature(modules) || \128(defined(__AVX512VL__) && defined(__AVX512DQ__))129#include <avx512vldqintrin.h>130#endif131132#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512ER__)133#include <avx512erintrin.h>134#endif135136#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512IFMA__)137#include <avx512ifmaintrin.h>138#endif139140#if !defined(_MSC_VER) || __has_feature(modules) || \141(defined(__AVX512IFMA__) && defined(__AVX512VL__))142#include <avx512ifmavlintrin.h>143#endif144145#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512VBMI__)146#include <avx512vbmiintrin.h>147#endif148149#if !defined(_MSC_VER) || __has_feature(modules) || \150(defined(__AVX512VBMI__) && defined(__AVX512VL__))151#include <avx512vbmivlintrin.h>152#endif153154#if !defined(_MSC_VER) || __has_feature(modules) || defined(__AVX512PF__)155#include <avx512pfintrin.h>156#endif157158#if !defined(_MSC_VER) || __has_feature(modules) || defined(__PKU__)159#include <pkuintrin.h>160#endif161162#if !defined(_MSC_VER) || __has_feature(modules) || defined(__RDRND__)163static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))164_rdrand16_step(unsigned short *__p)165{166return __builtin_ia32_rdrand16_step(__p);167}168169static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))170_rdrand32_step(unsigned int *__p)171{172return __builtin_ia32_rdrand32_step(__p);173}174175/* __bit_scan_forward */176static __inline__ int __attribute__((__always_inline__, __nodebug__))177_bit_scan_forward(int __A) {178return __builtin_ctz(__A);179}180181/* __bit_scan_reverse */182static __inline__ int __attribute__((__always_inline__, __nodebug__))183_bit_scan_reverse(int __A) {184return 31 - __builtin_clz(__A);185}186187#ifdef __x86_64__188static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))189_rdrand64_step(unsigned long long *__p)190{191return __builtin_ia32_rdrand64_step(__p);192}193#endif194#endif /* __RDRND__ */195196#if !defined(_MSC_VER) || __has_feature(modules) || defined(__FSGSBASE__)197#ifdef __x86_64__198static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))199_readfsbase_u32(void)200{201return __builtin_ia32_rdfsbase32();202}203204static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))205_readfsbase_u64(void)206{207return __builtin_ia32_rdfsbase64();208}209210static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))211_readgsbase_u32(void)212{213return __builtin_ia32_rdgsbase32();214}215216static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))217_readgsbase_u64(void)218{219return __builtin_ia32_rdgsbase64();220}221222static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))223_writefsbase_u32(unsigned int __V)224{225return __builtin_ia32_wrfsbase32(__V);226}227228static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))229_writefsbase_u64(unsigned long long __V)230{231return __builtin_ia32_wrfsbase64(__V);232}233234static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))235_writegsbase_u32(unsigned int __V)236{237return __builtin_ia32_wrgsbase32(__V);238}239240static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase")))241_writegsbase_u64(unsigned long long __V)242{243return __builtin_ia32_wrgsbase64(__V);244}245246#endif247#endif /* __FSGSBASE__ */248249#if !defined(_MSC_VER) || __has_feature(modules) || defined(__RTM__)250#include <rtmintrin.h>251#include <xtestintrin.h>252#endif253254#if !defined(_MSC_VER) || __has_feature(modules) || defined(__SHA__)255#include <shaintrin.h>256#endif257258#if !defined(_MSC_VER) || __has_feature(modules) || defined(__FXSR__)259#include <fxsrintrin.h>260#endif261262#if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVE__)263#include <xsaveintrin.h>264#endif265266#if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVEOPT__)267#include <xsaveoptintrin.h>268#endif269270#if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVEC__)271#include <xsavecintrin.h>272#endif273274#if !defined(_MSC_VER) || __has_feature(modules) || defined(__XSAVES__)275#include <xsavesintrin.h>276#endif277278/* Some intrinsics inside adxintrin.h are available only on processors with ADX,279* whereas others are also available at all times. */280#include <adxintrin.h>281282#endif /* __IMMINTRIN_H */283284285