Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 1 | /*===---- immintrin.h - Intel intrinsics -----------------------------------=== |
| 2 | * |
| 3 | * Permission is hereby granted, free of charge, to any person obtaining a copy |
| 4 | * of this software and associated documentation files (the "Software"), to deal |
| 5 | * in the Software without restriction, including without limitation the rights |
| 6 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 7 | * copies of the Software, and to permit persons to whom the Software is |
| 8 | * furnished to do so, subject to the following conditions: |
| 9 | * |
| 10 | * The above copyright notice and this permission notice shall be included in |
| 11 | * all copies or substantial portions of the Software. |
| 12 | * |
| 13 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 14 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 15 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 16 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 17 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 18 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 19 | * THE SOFTWARE. |
| 20 | * |
| 21 | *===-----------------------------------------------------------------------=== |
| 22 | */ |
| 23 | |
| 24 | #ifndef __IMMINTRIN_H |
| 25 | #define __IMMINTRIN_H |
| 26 | |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 27 | #include <mmintrin.h> |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 28 | |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 29 | #include <xmmintrin.h> |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 30 | |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 31 | #include <emmintrin.h> |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 32 | |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 33 | #include <pmmintrin.h> |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 34 | |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 35 | #include <tmmintrin.h> |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 36 | |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 37 | #include <smmintrin.h> |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 38 | |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 39 | #include <wmmintrin.h> |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 40 | |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 41 | #include <avxintrin.h> |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 42 | |
Craig Topper | dec792e | 2011-12-19 05:04:33 +0000 | [diff] [blame] | 43 | #include <avx2intrin.h> |
Craig Topper | dec792e | 2011-12-19 05:04:33 +0000 | [diff] [blame] | 44 | |
Craig Topper | f2855ad | 2011-12-25 06:25:37 +0000 | [diff] [blame] | 45 | #include <bmiintrin.h> |
Craig Topper | f2855ad | 2011-12-25 06:25:37 +0000 | [diff] [blame] | 46 | |
Craig Topper | c334dd6 | 2011-12-26 02:31:10 +0000 | [diff] [blame] | 47 | #include <bmi2intrin.h> |
Craig Topper | c334dd6 | 2011-12-26 02:31:10 +0000 | [diff] [blame] | 48 | |
Craig Topper | f2855ad | 2011-12-25 06:25:37 +0000 | [diff] [blame] | 49 | #include <lzcntintrin.h> |
Craig Topper | f2855ad | 2011-12-25 06:25:37 +0000 | [diff] [blame] | 50 | |
Craig Topper | 2b1eda3 | 2012-06-04 03:42:47 +0000 | [diff] [blame] | 51 | #include <fmaintrin.h> |
Craig Topper | 2b1eda3 | 2012-06-04 03:42:47 +0000 | [diff] [blame] | 52 | |
Elena Demikhovsky | fcc6df3 | 2014-07-22 11:31:39 +0000 | [diff] [blame] | 53 | #include <avx512fintrin.h> |
Elena Demikhovsky | fcc6df3 | 2014-07-22 11:31:39 +0000 | [diff] [blame] | 54 | |
Robert Khasanov | b9f3a91 | 2014-10-08 17:18:13 +0000 | [diff] [blame] | 55 | #include <avx512vlintrin.h> |
Robert Khasanov | b9f3a91 | 2014-10-08 17:18:13 +0000 | [diff] [blame] | 56 | |
Robert Khasanov | b9f3a91 | 2014-10-08 17:18:13 +0000 | [diff] [blame] | 57 | #include <avx512bwintrin.h> |
Robert Khasanov | b9f3a91 | 2014-10-08 17:18:13 +0000 | [diff] [blame] | 58 | |
Asaf Badouh | a45b7ca | 2015-06-29 12:51:53 +0000 | [diff] [blame] | 59 | #include <avx512cdintrin.h> |
| 60 | |
Elena Demikhovsky | e7d4c2e | 2015-04-30 09:24:29 +0000 | [diff] [blame] | 61 | #include <avx512dqintrin.h> |
Elena Demikhovsky | e7d4c2e | 2015-04-30 09:24:29 +0000 | [diff] [blame] | 62 | |
Robert Khasanov | b9f3a91 | 2014-10-08 17:18:13 +0000 | [diff] [blame] | 63 | #include <avx512vlbwintrin.h> |
Robert Khasanov | b9f3a91 | 2014-10-08 17:18:13 +0000 | [diff] [blame] | 64 | |
Elena Demikhovsky | e7d4c2e | 2015-04-30 09:24:29 +0000 | [diff] [blame] | 65 | #include <avx512vldqintrin.h> |
Elena Demikhovsky | e7d4c2e | 2015-04-30 09:24:29 +0000 | [diff] [blame] | 66 | |
Elena Demikhovsky | fcc6df3 | 2014-07-22 11:31:39 +0000 | [diff] [blame] | 67 | #include <avx512erintrin.h> |
Elena Demikhovsky | fcc6df3 | 2014-07-22 11:31:39 +0000 | [diff] [blame] | 68 | |
Eric Christopher | 9fc7fb2 | 2015-06-17 07:09:32 +0000 | [diff] [blame] | 69 | static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd"))) |
Benjamin Kramer | a43b699 | 2012-07-12 09:33:03 +0000 | [diff] [blame] | 70 | _rdrand16_step(unsigned short *__p) |
| 71 | { |
| 72 | return __builtin_ia32_rdrand16_step(__p); |
| 73 | } |
| 74 | |
Eric Christopher | 9fc7fb2 | 2015-06-17 07:09:32 +0000 | [diff] [blame] | 75 | static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd"))) |
Benjamin Kramer | a43b699 | 2012-07-12 09:33:03 +0000 | [diff] [blame] | 76 | _rdrand32_step(unsigned int *__p) |
| 77 | { |
| 78 | return __builtin_ia32_rdrand32_step(__p); |
| 79 | } |
| 80 | |
| 81 | #ifdef __x86_64__ |
Eric Christopher | 9fc7fb2 | 2015-06-17 07:09:32 +0000 | [diff] [blame] | 82 | static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd"))) |
Benjamin Kramer | a43b699 | 2012-07-12 09:33:03 +0000 | [diff] [blame] | 83 | _rdrand64_step(unsigned long long *__p) |
| 84 | { |
| 85 | return __builtin_ia32_rdrand64_step(__p); |
| 86 | } |
| 87 | #endif |
Benjamin Kramer | a43b699 | 2012-07-12 09:33:03 +0000 | [diff] [blame] | 88 | |
Craig Topper | 8c7f251 | 2014-11-03 06:51:41 +0000 | [diff] [blame] | 89 | #ifdef __x86_64__ |
Eric Christopher | 9fc7fb2 | 2015-06-17 07:09:32 +0000 | [diff] [blame] | 90 | static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) |
Craig Topper | 8c7f251 | 2014-11-03 06:51:41 +0000 | [diff] [blame] | 91 | _readfsbase_u32(void) |
| 92 | { |
| 93 | return __builtin_ia32_rdfsbase32(); |
| 94 | } |
| 95 | |
Eric Christopher | 9fc7fb2 | 2015-06-17 07:09:32 +0000 | [diff] [blame] | 96 | static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) |
Craig Topper | 8c7f251 | 2014-11-03 06:51:41 +0000 | [diff] [blame] | 97 | _readfsbase_u64(void) |
| 98 | { |
| 99 | return __builtin_ia32_rdfsbase64(); |
| 100 | } |
| 101 | |
Eric Christopher | 9fc7fb2 | 2015-06-17 07:09:32 +0000 | [diff] [blame] | 102 | static __inline__ unsigned int __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) |
Craig Topper | 8c7f251 | 2014-11-03 06:51:41 +0000 | [diff] [blame] | 103 | _readgsbase_u32(void) |
| 104 | { |
| 105 | return __builtin_ia32_rdgsbase32(); |
| 106 | } |
| 107 | |
Eric Christopher | 9fc7fb2 | 2015-06-17 07:09:32 +0000 | [diff] [blame] | 108 | static __inline__ unsigned long long __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) |
Craig Topper | 8c7f251 | 2014-11-03 06:51:41 +0000 | [diff] [blame] | 109 | _readgsbase_u64(void) |
| 110 | { |
| 111 | return __builtin_ia32_rdgsbase64(); |
| 112 | } |
| 113 | |
Eric Christopher | 9fc7fb2 | 2015-06-17 07:09:32 +0000 | [diff] [blame] | 114 | static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) |
Craig Topper | 8c7f251 | 2014-11-03 06:51:41 +0000 | [diff] [blame] | 115 | _writefsbase_u32(unsigned int __V) |
| 116 | { |
| 117 | return __builtin_ia32_wrfsbase32(__V); |
| 118 | } |
| 119 | |
Eric Christopher | 9fc7fb2 | 2015-06-17 07:09:32 +0000 | [diff] [blame] | 120 | static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) |
Craig Topper | 8c7f251 | 2014-11-03 06:51:41 +0000 | [diff] [blame] | 121 | _writefsbase_u64(unsigned long long __V) |
| 122 | { |
| 123 | return __builtin_ia32_wrfsbase64(__V); |
| 124 | } |
| 125 | |
Eric Christopher | 9fc7fb2 | 2015-06-17 07:09:32 +0000 | [diff] [blame] | 126 | static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) |
Craig Topper | 8c7f251 | 2014-11-03 06:51:41 +0000 | [diff] [blame] | 127 | _writegsbase_u32(unsigned int __V) |
| 128 | { |
| 129 | return __builtin_ia32_wrgsbase32(__V); |
| 130 | } |
| 131 | |
Eric Christopher | 9fc7fb2 | 2015-06-17 07:09:32 +0000 | [diff] [blame] | 132 | static __inline__ void __attribute__((__always_inline__, __nodebug__, __target__("fsgsbase"))) |
Craig Topper | 8c7f251 | 2014-11-03 06:51:41 +0000 | [diff] [blame] | 133 | _writegsbase_u64(unsigned long long __V) |
| 134 | { |
| 135 | return __builtin_ia32_wrgsbase64(__V); |
| 136 | } |
| 137 | #endif |
Craig Topper | 8c7f251 | 2014-11-03 06:51:41 +0000 | [diff] [blame] | 138 | |
Michael Liao | 625a875 | 2012-11-10 05:17:46 +0000 | [diff] [blame] | 139 | #include <rtmintrin.h> |
Michael Liao | 625a875 | 2012-11-10 05:17:46 +0000 | [diff] [blame] | 140 | |
Eric Christopher | 3d920ee | 2015-06-17 18:42:07 +0000 | [diff] [blame] | 141 | #include <xtestintrin.h> |
Michael Liao | 4442f79 | 2013-03-29 05:14:06 +0000 | [diff] [blame] | 142 | |
Ben Langmuir | 6efe3a8 | 2013-09-19 14:00:22 +0000 | [diff] [blame] | 143 | #include <shaintrin.h> |
Ben Langmuir | 6efe3a8 | 2013-09-19 14:00:22 +0000 | [diff] [blame] | 144 | |
Michael Kuperstein | a3c7b74 | 2015-06-30 09:45:38 +0000 | [diff] [blame] | 145 | #include <fxsrintrin.h> |
| 146 | |
Amjad Aboud | 2b9b8a5 | 2015-10-13 12:29:35 +0000 | [diff] [blame^] | 147 | #include <xsaveintrin.h> |
| 148 | |
| 149 | #include <xsaveoptintrin.h> |
| 150 | |
| 151 | #include <xsavecintrin.h> |
| 152 | |
| 153 | #include <xsavesintrin.h> |
| 154 | |
Eric Christopher | 29b7809 | 2015-06-17 18:42:03 +0000 | [diff] [blame] | 155 | /* Some intrinsics inside adxintrin.h are available only on processors with ADX, |
| 156 | * whereas others are also available at all times. */ |
Robert Khasanov | 83c419b | 2014-09-19 10:17:06 +0000 | [diff] [blame] | 157 | #include <adxintrin.h> |
| 158 | |
Benjamin Kramer | 65b9f7b | 2010-08-20 18:04:07 +0000 | [diff] [blame] | 159 | #endif /* __IMMINTRIN_H */ |