Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- X86.td - Target definition file for the Intel X86 --*- tablegen -*-===// |
Michael J. Spencer | b88784c | 2011-04-14 14:33:36 +0000 | [diff] [blame] | 2 | // |
John Criswell | 29265fe | 2003-10-21 15:17:13 +0000 | [diff] [blame] | 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
Chris Lattner | f3ebc3f | 2007-12-29 20:36:04 +0000 | [diff] [blame] | 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
Michael J. Spencer | b88784c | 2011-04-14 14:33:36 +0000 | [diff] [blame] | 7 | // |
John Criswell | 29265fe | 2003-10-21 15:17:13 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
Chris Lattner | 5da8e80 | 2003-08-03 15:47:49 +0000 | [diff] [blame] | 9 | // |
Craig Topper | 271064e | 2011-10-11 06:44:02 +0000 | [diff] [blame] | 10 | // This is a target description file for the Intel i386 architecture, referred |
| 11 | // to here as the "X86" architecture. |
Chris Lattner | 5da8e80 | 2003-08-03 15:47:49 +0000 | [diff] [blame] | 12 | // |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | |
Chris Lattner | 2551080 | 2003-08-04 04:59:56 +0000 | [diff] [blame] | 15 | // Get the target-independent interfaces which we are implementing... |
Chris Lattner | 5da8e80 | 2003-08-03 15:47:49 +0000 | [diff] [blame] | 16 | // |
Evan Cheng | 977e7be | 2008-11-24 07:34:46 +0000 | [diff] [blame] | 17 | include "llvm/Target/Target.td" |
Chris Lattner | 5da8e80 | 2003-08-03 15:47:49 +0000 | [diff] [blame] | 18 | |
| 19 | //===----------------------------------------------------------------------===// |
Anitha Boyapati | 426feb6 | 2012-08-16 03:50:04 +0000 | [diff] [blame] | 20 | // X86 Subtarget state |
Evan Cheng | 13bcc6c | 2011-07-07 21:06:52 +0000 | [diff] [blame] | 21 | // |
| 22 | |
| 23 | def Mode64Bit : SubtargetFeature<"64bit-mode", "In64BitMode", "true", |
| 24 | "64-bit mode (x86_64)">; |
Craig Topper | 3c80d62 | 2014-01-06 04:55:54 +0000 | [diff] [blame] | 25 | def Mode32Bit : SubtargetFeature<"32bit-mode", "In32BitMode", "true", |
| 26 | "32-bit mode (80386)">; |
| 27 | def Mode16Bit : SubtargetFeature<"16bit-mode", "In16BitMode", "true", |
| 28 | "16-bit mode (i8086)">; |
Evan Cheng | 13bcc6c | 2011-07-07 21:06:52 +0000 | [diff] [blame] | 29 | |
| 30 | //===----------------------------------------------------------------------===// |
Anitha Boyapati | 426feb6 | 2012-08-16 03:50:04 +0000 | [diff] [blame] | 31 | // X86 Subtarget features |
Bill Wendling | e618226 | 2007-05-04 20:38:40 +0000 | [diff] [blame] | 32 | //===----------------------------------------------------------------------===// |
Chris Lattner | cc8c581 | 2009-09-02 05:53:04 +0000 | [diff] [blame] | 33 | |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 34 | def FeatureX87 : SubtargetFeature<"x87","HasX87", "true", |
| 35 | "Enable X87 float instructions">; |
| 36 | |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 37 | def FeatureNOPL : SubtargetFeature<"nopl", "HasNOPL", "true", |
| 38 | "Enable NOPL instruction">; |
| 39 | |
Chris Lattner | cc8c581 | 2009-09-02 05:53:04 +0000 | [diff] [blame] | 40 | def FeatureCMOV : SubtargetFeature<"cmov","HasCMov", "true", |
| 41 | "Enable conditional move instructions">; |
| 42 | |
Benjamin Kramer | 2f48923 | 2010-12-04 20:32:23 +0000 | [diff] [blame] | 43 | def FeaturePOPCNT : SubtargetFeature<"popcnt", "HasPOPCNT", "true", |
| 44 | "Support POPCNT instruction">; |
| 45 | |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 46 | def FeatureFXSR : SubtargetFeature<"fxsr", "HasFXSR", "true", |
| 47 | "Support fxsave/fxrestore instructions">; |
| 48 | |
Amjad Aboud | 1db6d7a | 2015-10-12 11:47:46 +0000 | [diff] [blame] | 49 | def FeatureXSAVE : SubtargetFeature<"xsave", "HasXSAVE", "true", |
| 50 | "Support xsave instructions">; |
| 51 | |
| 52 | def FeatureXSAVEOPT: SubtargetFeature<"xsaveopt", "HasXSAVEOPT", "true", |
| 53 | "Support xsaveopt instructions">; |
| 54 | |
| 55 | def FeatureXSAVEC : SubtargetFeature<"xsavec", "HasXSAVEC", "true", |
| 56 | "Support xsavec instructions">; |
| 57 | |
| 58 | def FeatureXSAVES : SubtargetFeature<"xsaves", "HasXSAVES", "true", |
| 59 | "Support xsaves instructions">; |
| 60 | |
Bill Wendling | e618226 | 2007-05-04 20:38:40 +0000 | [diff] [blame] | 61 | def FeatureSSE1 : SubtargetFeature<"sse", "X86SSELevel", "SSE1", |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 62 | "Enable SSE instructions">; |
Bill Wendling | e618226 | 2007-05-04 20:38:40 +0000 | [diff] [blame] | 63 | def FeatureSSE2 : SubtargetFeature<"sse2", "X86SSELevel", "SSE2", |
| 64 | "Enable SSE2 instructions", |
| 65 | [FeatureSSE1]>; |
| 66 | def FeatureSSE3 : SubtargetFeature<"sse3", "X86SSELevel", "SSE3", |
| 67 | "Enable SSE3 instructions", |
| 68 | [FeatureSSE2]>; |
| 69 | def FeatureSSSE3 : SubtargetFeature<"ssse3", "X86SSELevel", "SSSE3", |
| 70 | "Enable SSSE3 instructions", |
| 71 | [FeatureSSE3]>; |
Rafael Espindola | 94a2c56 | 2013-08-23 20:21:34 +0000 | [diff] [blame] | 72 | def FeatureSSE41 : SubtargetFeature<"sse4.1", "X86SSELevel", "SSE41", |
Nate Begeman | e14fdfa | 2008-02-03 07:18:54 +0000 | [diff] [blame] | 73 | "Enable SSE 4.1 instructions", |
| 74 | [FeatureSSSE3]>; |
Rafael Espindola | 94a2c56 | 2013-08-23 20:21:34 +0000 | [diff] [blame] | 75 | def FeatureSSE42 : SubtargetFeature<"sse4.2", "X86SSELevel", "SSE42", |
Nate Begeman | e14fdfa | 2008-02-03 07:18:54 +0000 | [diff] [blame] | 76 | "Enable SSE 4.2 instructions", |
Craig Topper | 7bd3305 | 2011-12-29 15:51:45 +0000 | [diff] [blame] | 77 | [FeatureSSE41]>; |
Eric Christopher | 57a6e13 | 2015-11-14 03:04:00 +0000 | [diff] [blame] | 78 | // The MMX subtarget feature is separate from the rest of the SSE features |
| 79 | // because it's important (for odd compatibility reasons) to be able to |
| 80 | // turn it off explicitly while allowing SSE+ to be on. |
| 81 | def FeatureMMX : SubtargetFeature<"mmx","X863DNowLevel", "MMX", |
| 82 | "Enable MMX instructions">; |
Bill Wendling | e618226 | 2007-05-04 20:38:40 +0000 | [diff] [blame] | 83 | def Feature3DNow : SubtargetFeature<"3dnow", "X863DNowLevel", "ThreeDNow", |
Michael J. Spencer | 30088ba | 2011-04-15 00:32:41 +0000 | [diff] [blame] | 84 | "Enable 3DNow! instructions", |
| 85 | [FeatureMMX]>; |
Bill Wendling | e618226 | 2007-05-04 20:38:40 +0000 | [diff] [blame] | 86 | def Feature3DNowA : SubtargetFeature<"3dnowa", "X863DNowLevel", "ThreeDNowA", |
Bill Wendling | f985c49 | 2007-05-06 07:56:19 +0000 | [diff] [blame] | 87 | "Enable 3DNow! Athlon instructions", |
| 88 | [Feature3DNow]>; |
Dan Gohman | 7403751 | 2009-02-03 00:04:43 +0000 | [diff] [blame] | 89 | // All x86-64 hardware has SSE2, but we don't mark SSE2 as an implied |
| 90 | // feature, because SSE2 can be disabled (e.g. for compiling OS kernels) |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 91 | // without disabling 64-bit mode. Nothing should imply this feature bit. It |
| 92 | // is used to enforce that only 64-bit capable CPUs are used in 64-bit mode. |
Bill Wendling | f985c49 | 2007-05-06 07:56:19 +0000 | [diff] [blame] | 93 | def Feature64Bit : SubtargetFeature<"64bit", "HasX86_64", "true", |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 94 | "Support 64-bit instructions">; |
Nick Lewycky | 3be42b8 | 2013-10-05 20:11:44 +0000 | [diff] [blame] | 95 | def FeatureCMPXCHG16B : SubtargetFeature<"cx16", "HasCmpxchg16b", "true", |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 96 | "64-bit with cmpxchg16b">; |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 97 | def FeatureSlowSHLD : SubtargetFeature<"slow-shld", "IsSHLDSlow", "true", |
| 98 | "SHLD instruction is slow">; |
Zvi Rackover | 8bc7e4d | 2016-12-06 19:35:20 +0000 | [diff] [blame] | 99 | def FeatureSlowPMULLD : SubtargetFeature<"slow-pmulld", "IsPMULLDSlow", "true", |
| 100 | "PMULLD instruction is slow">; |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 101 | // FIXME: This should not apply to CPUs that do not have SSE. |
| 102 | def FeatureSlowUAMem16 : SubtargetFeature<"slow-unaligned-mem-16", |
| 103 | "IsUAMem16Slow", "true", |
| 104 | "Slow unaligned 16-byte memory access">; |
Sanjay Patel | 501890e | 2014-11-21 17:40:04 +0000 | [diff] [blame] | 105 | def FeatureSlowUAMem32 : SubtargetFeature<"slow-unaligned-mem-32", |
Sanjay Patel | 9e916dc | 2015-08-21 20:17:26 +0000 | [diff] [blame] | 106 | "IsUAMem32Slow", "true", |
| 107 | "Slow unaligned 32-byte memory access">; |
Stefanus Du Toit | 96180b5 | 2009-05-26 21:04:35 +0000 | [diff] [blame] | 108 | def FeatureSSE4A : SubtargetFeature<"sse4a", "HasSSE4A", "true", |
Craig Topper | a5d1fc2 | 2011-12-30 07:16:00 +0000 | [diff] [blame] | 109 | "Support SSE 4a instructions", |
| 110 | [FeatureSSE3]>; |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 111 | |
Craig Topper | f287a45 | 2012-01-09 09:02:13 +0000 | [diff] [blame] | 112 | def FeatureAVX : SubtargetFeature<"avx", "X86SSELevel", "AVX", |
| 113 | "Enable AVX instructions", |
| 114 | [FeatureSSE42]>; |
| 115 | def FeatureAVX2 : SubtargetFeature<"avx2", "X86SSELevel", "AVX2", |
Craig Topper | 228d913 | 2011-10-30 19:57:21 +0000 | [diff] [blame] | 116 | "Enable AVX2 instructions", |
| 117 | [FeatureAVX]>; |
Craig Topper | cb6c386 | 2017-11-06 22:49:01 +0000 | [diff] [blame] | 118 | def FeatureFMA : SubtargetFeature<"fma", "HasFMA", "true", |
| 119 | "Enable three-operand fused multiple-add", |
| 120 | [FeatureAVX]>; |
Craig Topper | 428a4e6 | 2017-11-06 22:49:04 +0000 | [diff] [blame] | 121 | def FeatureF16C : SubtargetFeature<"f16c", "HasF16C", "true", |
| 122 | "Support 16-bit floating point conversion instructions", |
| 123 | [FeatureAVX]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 124 | def FeatureAVX512 : SubtargetFeature<"avx512f", "X86SSELevel", "AVX512F", |
Elena Demikhovsky | 8cfb43f | 2013-07-24 11:02:47 +0000 | [diff] [blame] | 125 | "Enable AVX-512 instructions", |
Craig Topper | 428a4e6 | 2017-11-06 22:49:04 +0000 | [diff] [blame] | 126 | [FeatureAVX2, FeatureFMA, FeatureF16C]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 127 | def FeatureERI : SubtargetFeature<"avx512er", "HasERI", "true", |
Elena Demikhovsky | 003e7d7 | 2013-07-28 08:28:38 +0000 | [diff] [blame] | 128 | "Enable AVX-512 Exponential and Reciprocal Instructions", |
| 129 | [FeatureAVX512]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 130 | def FeatureCDI : SubtargetFeature<"avx512cd", "HasCDI", "true", |
Elena Demikhovsky | 003e7d7 | 2013-07-28 08:28:38 +0000 | [diff] [blame] | 131 | "Enable AVX-512 Conflict Detection Instructions", |
| 132 | [FeatureAVX512]>; |
Oren Ben Simhon | 7bf27f0 | 2017-05-25 13:45:23 +0000 | [diff] [blame] | 133 | def FeatureVPOPCNTDQ : SubtargetFeature<"avx512vpopcntdq", "HasVPOPCNTDQ", |
| 134 | "true", "Enable AVX-512 Population Count Instructions", |
| 135 | [FeatureAVX512]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 136 | def FeaturePFI : SubtargetFeature<"avx512pf", "HasPFI", "true", |
Elena Demikhovsky | 003e7d7 | 2013-07-28 08:28:38 +0000 | [diff] [blame] | 137 | "Enable AVX-512 PreFetch Instructions", |
| 138 | [FeatureAVX512]>; |
Craig Topper | e268598 | 2017-12-22 02:30:30 +0000 | [diff] [blame] | 139 | def FeaturePREFETCHWT1 : SubtargetFeature<"prefetchwt1", "HasPREFETCHWT1", |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 140 | "true", |
| 141 | "Prefetch with Intent to Write and T1 Hint">; |
Robert Khasanov | bfa0131 | 2014-07-21 14:54:21 +0000 | [diff] [blame] | 142 | def FeatureDQI : SubtargetFeature<"avx512dq", "HasDQI", "true", |
| 143 | "Enable AVX-512 Doubleword and Quadword Instructions", |
| 144 | [FeatureAVX512]>; |
| 145 | def FeatureBWI : SubtargetFeature<"avx512bw", "HasBWI", "true", |
| 146 | "Enable AVX-512 Byte and Word Instructions", |
| 147 | [FeatureAVX512]>; |
| 148 | def FeatureVLX : SubtargetFeature<"avx512vl", "HasVLX", "true", |
| 149 | "Enable AVX-512 Vector Length eXtensions", |
| 150 | [FeatureAVX512]>; |
Michael Zuckerman | 97b6a692 | 2016-01-17 13:42:12 +0000 | [diff] [blame] | 151 | def FeatureVBMI : SubtargetFeature<"avx512vbmi", "HasVBMI", "true", |
Craig Topper | 5c842be | 2016-11-09 04:50:48 +0000 | [diff] [blame] | 152 | "Enable AVX-512 Vector Byte Manipulation Instructions", |
| 153 | [FeatureBWI]>; |
Coby Tayree | 71e37cc | 2017-11-21 09:48:44 +0000 | [diff] [blame] | 154 | def FeatureVBMI2 : SubtargetFeature<"avx512vbmi2", "HasVBMI2", "true", |
| 155 | "Enable AVX-512 further Vector Byte Manipulation Instructions", |
| 156 | [FeatureBWI]>; |
Craig Topper | 3bb3f73 | 2016-02-08 01:23:15 +0000 | [diff] [blame] | 157 | def FeatureIFMA : SubtargetFeature<"avx512ifma", "HasIFMA", "true", |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 158 | "Enable AVX-512 Integer Fused Multiple-Add", |
| 159 | [FeatureAVX512]>; |
Asaf Badouh | 5acf66f | 2015-12-15 13:35:29 +0000 | [diff] [blame] | 160 | def FeaturePKU : SubtargetFeature<"pku", "HasPKU", "true", |
| 161 | "Enable protection keys">; |
Coby Tayree | 3880f2a | 2017-11-21 10:04:28 +0000 | [diff] [blame] | 162 | def FeatureVNNI : SubtargetFeature<"avx512vnni", "HasVNNI", "true", |
| 163 | "Enable AVX-512 Vector Neural Network Instructions", |
| 164 | [FeatureAVX512]>; |
Coby Tayree | 5c7fe5d | 2017-11-21 10:32:42 +0000 | [diff] [blame] | 165 | def FeatureBITALG : SubtargetFeature<"avx512bitalg", "HasBITALG", "true", |
| 166 | "Enable AVX-512 Bit Algorithms", |
| 167 | [FeatureBWI]>; |
Benjamin Kramer | a0396e4 | 2012-05-31 14:34:17 +0000 | [diff] [blame] | 168 | def FeaturePCLMUL : SubtargetFeature<"pclmul", "HasPCLMUL", "true", |
| 169 | "Enable packed carry-less multiplication instructions", |
Craig Topper | 29dd148 | 2012-05-01 05:28:32 +0000 | [diff] [blame] | 170 | [FeatureSSE2]>; |
Coby Tayree | d8b17be | 2017-11-26 09:36:41 +0000 | [diff] [blame] | 171 | def FeatureGFNI : SubtargetFeature<"gfni", "HasGFNI", "true", |
| 172 | "Enable Galois Field Arithmetic Instructions", |
| 173 | [FeatureSSE2]>; |
Coby Tayree | 7ca5e587 | 2017-11-21 09:30:33 +0000 | [diff] [blame] | 174 | def FeatureVPCLMULQDQ : SubtargetFeature<"vpclmulqdq", "HasVPCLMULQDQ", "true", |
| 175 | "Enable vpclmulqdq instructions", |
| 176 | [FeatureAVX, FeaturePCLMUL]>; |
David Greene | 8f6f72c | 2009-06-26 22:46:54 +0000 | [diff] [blame] | 177 | def FeatureFMA4 : SubtargetFeature<"fma4", "HasFMA4", "true", |
Craig Topper | a5d1fc2 | 2011-12-30 07:16:00 +0000 | [diff] [blame] | 178 | "Enable four-operand fused multiple-add", |
Craig Topper | bae0e9e | 2012-05-01 06:54:48 +0000 | [diff] [blame] | 179 | [FeatureAVX, FeatureSSE4A]>; |
Craig Topper | a5d1fc2 | 2011-12-30 07:16:00 +0000 | [diff] [blame] | 180 | def FeatureXOP : SubtargetFeature<"xop", "HasXOP", "true", |
Craig Topper | 43518cc | 2012-05-01 05:41:41 +0000 | [diff] [blame] | 181 | "Enable XOP instructions", |
Anitha Boyapati | af3e983 | 2012-08-16 04:04:02 +0000 | [diff] [blame] | 182 | [FeatureFMA4]>; |
Sanjay Patel | ffd039b | 2015-02-03 17:13:04 +0000 | [diff] [blame] | 183 | def FeatureSSEUnalignedMem : SubtargetFeature<"sse-unaligned-mem", |
| 184 | "HasSSEUnalignedMem", "true", |
| 185 | "Allow unaligned memory operands with SSE instructions">; |
Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 186 | def FeatureAES : SubtargetFeature<"aes", "HasAES", "true", |
Craig Topper | 29dd148 | 2012-05-01 05:28:32 +0000 | [diff] [blame] | 187 | "Enable AES instructions", |
| 188 | [FeatureSSE2]>; |
Coby Tayree | 2a1c02f | 2017-11-21 09:11:41 +0000 | [diff] [blame] | 189 | def FeatureVAES : SubtargetFeature<"vaes", "HasVAES", "true", |
| 190 | "Promote selected AES instructions to AVX512/AVX registers", |
| 191 | [FeatureAVX, FeatureAES]>; |
Yunzhong Gao | dd36e93 | 2013-09-24 18:21:52 +0000 | [diff] [blame] | 192 | def FeatureTBM : SubtargetFeature<"tbm", "HasTBM", "true", |
| 193 | "Enable TBM instructions">; |
Simon Pilgrim | 99b925b | 2017-05-03 15:51:39 +0000 | [diff] [blame] | 194 | def FeatureLWP : SubtargetFeature<"lwp", "HasLWP", "true", |
| 195 | "Enable LWP instructions">; |
Craig Topper | 786bdb9 | 2011-10-03 17:28:23 +0000 | [diff] [blame] | 196 | def FeatureMOVBE : SubtargetFeature<"movbe", "HasMOVBE", "true", |
| 197 | "Support MOVBE instruction">; |
Rafael Espindola | 94a2c56 | 2013-08-23 20:21:34 +0000 | [diff] [blame] | 198 | def FeatureRDRAND : SubtargetFeature<"rdrnd", "HasRDRAND", "true", |
Craig Topper | 786bdb9 | 2011-10-03 17:28:23 +0000 | [diff] [blame] | 199 | "Support RDRAND instruction">; |
Craig Topper | 228d913 | 2011-10-30 19:57:21 +0000 | [diff] [blame] | 200 | def FeatureFSGSBase : SubtargetFeature<"fsgsbase", "HasFSGSBase", "true", |
| 201 | "Support FS/GS Base instructions">; |
Craig Topper | 271064e | 2011-10-11 06:44:02 +0000 | [diff] [blame] | 202 | def FeatureLZCNT : SubtargetFeature<"lzcnt", "HasLZCNT", "true", |
| 203 | "Support LZCNT instruction">; |
Craig Topper | 3657fe4 | 2011-10-14 03:21:46 +0000 | [diff] [blame] | 204 | def FeatureBMI : SubtargetFeature<"bmi", "HasBMI", "true", |
| 205 | "Support BMI instructions">; |
Craig Topper | aea148c | 2011-10-16 07:55:05 +0000 | [diff] [blame] | 206 | def FeatureBMI2 : SubtargetFeature<"bmi2", "HasBMI2", "true", |
| 207 | "Support BMI2 instructions">; |
Michael Liao | 73cffdd | 2012-11-08 07:28:54 +0000 | [diff] [blame] | 208 | def FeatureRTM : SubtargetFeature<"rtm", "HasRTM", "true", |
| 209 | "Support RTM instructions">; |
Kay Tiong Khoo | f809c64 | 2013-02-14 19:08:21 +0000 | [diff] [blame] | 210 | def FeatureADX : SubtargetFeature<"adx", "HasADX", "true", |
| 211 | "Support ADX instructions">; |
Ben Langmuir | 1650175 | 2013-09-12 15:51:31 +0000 | [diff] [blame] | 212 | def FeatureSHA : SubtargetFeature<"sha", "HasSHA", "true", |
| 213 | "Enable SHA instructions", |
| 214 | [FeatureSSE2]>; |
Oren Ben Simhon | fa582b0 | 2017-11-26 13:02:45 +0000 | [diff] [blame] | 215 | def FeatureSHSTK : SubtargetFeature<"shstk", "HasSHSTK", "true", |
| 216 | "Support CET Shadow-Stack instructions">; |
Michael Liao | 5173ee0 | 2013-03-26 17:47:11 +0000 | [diff] [blame] | 217 | def FeaturePRFCHW : SubtargetFeature<"prfchw", "HasPRFCHW", "true", |
| 218 | "Support PRFCHW instructions">; |
Michael Liao | a486a11 | 2013-03-28 23:41:26 +0000 | [diff] [blame] | 219 | def FeatureRDSEED : SubtargetFeature<"rdseed", "HasRDSEED", "true", |
| 220 | "Support RDSEED instruction">; |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 221 | def FeatureLAHFSAHF : SubtargetFeature<"sahf", "HasLAHFSAHF", "true", |
| 222 | "Support LAHF and SAHF instructions">; |
Ashutosh Nema | 348af9c | 2016-05-18 11:59:12 +0000 | [diff] [blame] | 223 | def FeatureMWAITX : SubtargetFeature<"mwaitx", "HasMWAITX", "true", |
| 224 | "Enable MONITORX/MWAITX timer functionality">; |
Craig Topper | 50f3d14 | 2017-02-09 04:27:34 +0000 | [diff] [blame] | 225 | def FeatureCLZERO : SubtargetFeature<"clzero", "HasCLZERO", "true", |
| 226 | "Enable Cache Line Zero">; |
Gabor Buella | 604be44 | 2018-04-13 07:35:08 +0000 | [diff] [blame] | 227 | def FeatureCLDEMOTE : SubtargetFeature<"cldemote", "HasCLDEMOTE", "true", |
| 228 | "Enable Cache Demote">; |
Gabor Buella | a832b22 | 2018-05-10 07:26:05 +0000 | [diff] [blame] | 229 | def FeaturePTWRITE : SubtargetFeature<"ptwrite", "HasPTWRITE", "true", |
| 230 | "Support ptwrite instruction">; |
Elena Demikhovsky | f7e641c | 2015-06-03 10:30:57 +0000 | [diff] [blame] | 231 | def FeatureMPX : SubtargetFeature<"mpx", "HasMPX", "true", |
| 232 | "Support MPX instructions">; |
Sanjay Patel | 53d1d8b | 2015-10-12 15:24:01 +0000 | [diff] [blame] | 233 | def FeatureLEAForSP : SubtargetFeature<"lea-sp", "UseLeaForSP", "true", |
Evan Cheng | 1b81fdd | 2012-02-07 22:50:41 +0000 | [diff] [blame] | 234 | "Use LEA for adjusting the stack pointer">; |
Alexey Volkov | fd1731d | 2014-11-21 11:19:34 +0000 | [diff] [blame] | 235 | def FeatureSlowDivide32 : SubtargetFeature<"idivl-to-divb", |
| 236 | "HasSlowDivide32", "true", |
| 237 | "Use 8-bit divide for positive values less than 256">; |
Nikolai Bozhenov | 6bdf92c | 2017-01-12 19:34:15 +0000 | [diff] [blame] | 238 | def FeatureSlowDivide64 : SubtargetFeature<"idivq-to-divl", |
Alexey Volkov | fd1731d | 2014-11-21 11:19:34 +0000 | [diff] [blame] | 239 | "HasSlowDivide64", "true", |
Nikolai Bozhenov | 6bdf92c | 2017-01-12 19:34:15 +0000 | [diff] [blame] | 240 | "Use 32-bit divide for positive values less than 2^32">; |
Preston Gurd | a01daac | 2013-01-08 18:27:24 +0000 | [diff] [blame] | 241 | def FeaturePadShortFunctions : SubtargetFeature<"pad-short-functions", |
| 242 | "PadShortFunctions", "true", |
| 243 | "Pad short functions">; |
Gabor Buella | d2f1ab1 | 2018-05-25 06:32:05 +0000 | [diff] [blame] | 244 | def FeatureINVPCID : SubtargetFeature<"invpcid", "HasINVPCID", "true", |
| 245 | "Invalidate Process-Context Identifier">; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 246 | def FeatureSGX : SubtargetFeature<"sgx", "HasSGX", "true", |
| 247 | "Enable Software Guard Extensions">; |
| 248 | def FeatureCLFLUSHOPT : SubtargetFeature<"clflushopt", "HasCLFLUSHOPT", "true", |
| 249 | "Flush A Cache Line Optimized">; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 250 | def FeatureCLWB : SubtargetFeature<"clwb", "HasCLWB", "true", |
| 251 | "Cache Line Write Back">; |
Gabor Buella | 2ef36f3 | 2018-04-11 20:01:57 +0000 | [diff] [blame] | 252 | def FeatureWBNOINVD : SubtargetFeature<"wbnoinvd", "HasWBNOINVD", "true", |
| 253 | "Write Back No Invalidate">; |
Craig Topper | 84b26b9 | 2018-01-18 23:52:31 +0000 | [diff] [blame] | 254 | def FeatureRDPID : SubtargetFeature<"rdpid", "HasRDPID", "true", |
| 255 | "Support RDPID instructions">; |
Gabor Buella | 31fa802 | 2018-04-20 18:42:47 +0000 | [diff] [blame] | 256 | def FeatureWAITPKG : SubtargetFeature<"waitpkg", "HasWAITPKG", "true", |
| 257 | "Wait and pause enhancements">; |
Craig Topper | 62c47a2 | 2017-08-29 05:14:27 +0000 | [diff] [blame] | 258 | // On some processors, instructions that implicitly take two memory operands are |
| 259 | // slow. In practice, this means that CALL, PUSH, and POP with memory operands |
| 260 | // should be avoided in favor of a MOV + register CALL/PUSH/POP. |
| 261 | def FeatureSlowTwoMemOps : SubtargetFeature<"slow-two-mem-ops", |
| 262 | "SlowTwoMemOps", "true", |
| 263 | "Two memory operand instructions are slow">; |
Preston Gurd | 8b7ab4b | 2013-04-25 20:29:37 +0000 | [diff] [blame] | 264 | def FeatureLEAUsesAG : SubtargetFeature<"lea-uses-ag", "LEAUsesAG", "true", |
| 265 | "LEA instruction needs inputs at AG stage">; |
Alexey Volkov | 6226de6 | 2014-05-20 08:55:50 +0000 | [diff] [blame] | 266 | def FeatureSlowLEA : SubtargetFeature<"slow-lea", "SlowLEA", "true", |
| 267 | "LEA instruction with certain arguments is slow">; |
Lama Saba | 2ea271b | 2017-05-18 08:11:50 +0000 | [diff] [blame] | 268 | def FeatureSlow3OpsLEA : SubtargetFeature<"slow-3ops-lea", "Slow3OpsLEA", "true", |
| 269 | "LEA instruction with 3 ops or certain registers is slow">; |
Alexey Volkov | 5260dba | 2014-06-09 11:40:41 +0000 | [diff] [blame] | 270 | def FeatureSlowIncDec : SubtargetFeature<"slow-incdec", "SlowIncDec", "true", |
| 271 | "INC and DEC instructions are slower than ADD and SUB">; |
Eric Christopher | 824f42f | 2015-05-12 01:26:05 +0000 | [diff] [blame] | 272 | def FeatureSoftFloat |
| 273 | : SubtargetFeature<"soft-float", "UseSoftFloat", "true", |
| 274 | "Use software floating point features.">; |
Marina Yatsina | 77a21db | 2018-01-22 10:07:01 +0000 | [diff] [blame] | 275 | def FeaturePOPCNTFalseDeps : SubtargetFeature<"false-deps-popcnt", |
| 276 | "HasPOPCNTFalseDeps", "true", |
| 277 | "POPCNT has a false dependency on dest register">; |
| 278 | def FeatureLZCNTFalseDeps : SubtargetFeature<"false-deps-lzcnt-tzcnt", |
| 279 | "HasLZCNTFalseDeps", "true", |
| 280 | "LZCNT/TZCNT have a false dependency on dest register">; |
Gabor Buella | 2b5e960 | 2018-05-08 06:47:36 +0000 | [diff] [blame] | 281 | def FeaturePCONFIG : SubtargetFeature<"pconfig", "HasPCONFIG", "true", |
| 282 | "platform configuration instruction">; |
Simon Pilgrim | fd5df63 | 2017-12-19 13:16:43 +0000 | [diff] [blame] | 283 | // On recent X86 (port bound) processors, its preferable to combine to a single shuffle |
| 284 | // using a variable mask over multiple fixed shuffles. |
| 285 | def FeatureFastVariableShuffle |
| 286 | : SubtargetFeature<"fast-variable-shuffle", |
| 287 | "HasFastVariableShuffle", |
| 288 | "true", "Shuffles with variable masks are fast">; |
Amjad Aboud | 4f97751 | 2017-03-03 09:03:24 +0000 | [diff] [blame] | 289 | // On some X86 processors, there is no performance hazard to writing only the |
| 290 | // lower parts of a YMM or ZMM register without clearing the upper part. |
| 291 | def FeatureFastPartialYMMorZMMWrite |
| 292 | : SubtargetFeature<"fast-partial-ymm-or-zmm-write", |
| 293 | "HasFastPartialYMMorZMMWrite", |
| 294 | "true", "Partial writes to YMM/ZMM registers are fast">; |
Nikolai Bozhenov | f679530 | 2016-08-04 12:47:28 +0000 | [diff] [blame] | 295 | // FeatureFastScalarFSQRT should be enabled if scalar FSQRT has shorter latency |
| 296 | // than the corresponding NR code. FeatureFastVectorFSQRT should be enabled if |
| 297 | // vector FSQRT has higher throughput than the corresponding NR code. |
| 298 | // The idea is that throughput bound code is likely to be vectorized, so for |
| 299 | // vectorized code we should care about the throughput of SQRT operations. |
| 300 | // But if the code is scalar that probably means that the code has some kind of |
| 301 | // dependency and we should care more about reducing the latency. |
| 302 | def FeatureFastScalarFSQRT |
| 303 | : SubtargetFeature<"fast-scalar-fsqrt", "HasFastScalarFSQRT", |
| 304 | "true", "Scalar SQRT is fast (disable Newton-Raphson)">; |
| 305 | def FeatureFastVectorFSQRT |
| 306 | : SubtargetFeature<"fast-vector-fsqrt", "HasFastVectorFSQRT", |
| 307 | "true", "Vector SQRT is fast (disable Newton-Raphson)">; |
Pierre Gousseau | b6d652a | 2016-10-14 16:41:38 +0000 | [diff] [blame] | 308 | // If lzcnt has equivalent latency/throughput to most simple integer ops, it can |
| 309 | // be used to replace test/set sequences. |
| 310 | def FeatureFastLZCNT |
| 311 | : SubtargetFeature< |
| 312 | "fast-lzcnt", "HasFastLZCNT", "true", |
| 313 | "LZCNT instructions are as fast as most simple integer ops">; |
Simon Pilgrim | 02bdac5 | 2018-01-29 21:24:31 +0000 | [diff] [blame] | 314 | // If the target can efficiently decode NOPs upto 11-bytes in length. |
| 315 | def FeatureFast11ByteNOP |
| 316 | : SubtargetFeature< |
| 317 | "fast-11bytenop", "HasFast11ByteNOP", "true", |
| 318 | "Target can quickly decode up to 11 byte NOPs">; |
| 319 | // If the target can efficiently decode NOPs upto 15-bytes in length. |
| 320 | def FeatureFast15ByteNOP |
| 321 | : SubtargetFeature< |
| 322 | "fast-15bytenop", "HasFast15ByteNOP", "true", |
| 323 | "Target can quickly decode up to 15 byte NOPs">; |
Craig Topper | d88389a | 2017-02-21 06:39:13 +0000 | [diff] [blame] | 324 | // Sandy Bridge and newer processors can use SHLD with the same source on both |
| 325 | // inputs to implement rotate to avoid the partial flag update of the normal |
| 326 | // rotate instructions. |
| 327 | def FeatureFastSHLDRotate |
| 328 | : SubtargetFeature< |
| 329 | "fast-shld-rotate", "HasFastSHLDRotate", "true", |
| 330 | "SHLD can be used as a faster rotate">; |
| 331 | |
Clement Courbet | 203fc17 | 2017-04-21 09:20:50 +0000 | [diff] [blame] | 332 | // Ivy Bridge and newer processors have enhanced REP MOVSB and STOSB (aka |
| 333 | // "string operations"). See "REP String Enhancement" in the Intel Software |
Clement Courbet | 41b4333 | 2017-04-21 09:21:05 +0000 | [diff] [blame] | 334 | // Development Manual. This feature essentially means that REP MOVSB will copy |
Clement Courbet | 203fc17 | 2017-04-21 09:20:50 +0000 | [diff] [blame] | 335 | // using the largest available size instead of copying bytes one by one, making |
| 336 | // it at least as fast as REPMOVS{W,D,Q}. |
| 337 | def FeatureERMSB |
Clement Courbet | 1ce3b82 | 2017-04-21 09:20:39 +0000 | [diff] [blame] | 338 | : SubtargetFeature< |
Clement Courbet | 203fc17 | 2017-04-21 09:20:50 +0000 | [diff] [blame] | 339 | "ermsb", "HasERMSB", "true", |
Clement Courbet | 1ce3b82 | 2017-04-21 09:20:39 +0000 | [diff] [blame] | 340 | "REP MOVS/STOS are fast">; |
| 341 | |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 342 | // Sandy Bridge and newer processors have many instructions that can be |
| 343 | // fused with conditional branches and pass through the CPU as a single |
| 344 | // operation. |
| 345 | def FeatureMacroFusion |
| 346 | : SubtargetFeature<"macrofusion", "HasMacroFusion", "true", |
| 347 | "Various instructions can be fused with conditional branches">; |
| 348 | |
Craig Topper | ea37e20 | 2017-11-25 18:09:37 +0000 | [diff] [blame] | 349 | // Gather is available since Haswell (AVX2 set). So technically, we can |
| 350 | // generate Gathers on all AVX2 processors. But the overhead on HSW is high. |
| 351 | // Skylake Client processor has faster Gathers than HSW and performance is |
| 352 | // similar to Skylake Server (AVX-512). |
| 353 | def FeatureHasFastGather |
| 354 | : SubtargetFeature<"fast-gather", "HasFastGather", "true", |
| 355 | "Indicates if gather is reasonably fast.">; |
| 356 | |
Craig Topper | 0d797a3 | 2018-01-20 00:26:08 +0000 | [diff] [blame] | 357 | def FeaturePrefer256Bit |
| 358 | : SubtargetFeature<"prefer-256-bit", "Prefer256Bit", "true", |
| 359 | "Prefer 256-bit AVX instructions">; |
| 360 | |
Chandler Carruth | ae0cafe | 2018-08-23 06:06:38 +0000 | [diff] [blame] | 361 | // Lower indirect calls using a special construct called a `retpoline` to |
| 362 | // mitigate potential Spectre v2 attacks against them. |
| 363 | def FeatureRetpolineIndirectCalls |
| 364 | : SubtargetFeature< |
| 365 | "retpoline-indirect-calls", "UseRetpolineIndirectCalls", "true", |
| 366 | "Remove speculation of indirect calls from the generated code.">; |
| 367 | |
| 368 | // Lower indirect branches and switches either using conditional branch trees |
| 369 | // or using a special construct called a `retpoline` to mitigate potential |
| 370 | // Spectre v2 attacks against them. |
| 371 | def FeatureRetpolineIndirectBranches |
| 372 | : SubtargetFeature< |
| 373 | "retpoline-indirect-branches", "UseRetpolineIndirectBranches", "true", |
| 374 | "Remove speculation of indirect branches from the generated code.">; |
| 375 | |
| 376 | // Deprecated umbrella feature for enabling both `retpoline-indirect-calls` and |
| 377 | // `retpoline-indirect-branches` above. |
Chandler Carruth | c58f216 | 2018-01-22 22:05:25 +0000 | [diff] [blame] | 378 | def FeatureRetpoline |
Chandler Carruth | ae0cafe | 2018-08-23 06:06:38 +0000 | [diff] [blame] | 379 | : SubtargetFeature<"retpoline", "DeprecatedUseRetpoline", "true", |
Chandler Carruth | c58f216 | 2018-01-22 22:05:25 +0000 | [diff] [blame] | 380 | "Remove speculation of indirect branches from the " |
| 381 | "generated code, either by avoiding them entirely or " |
Chandler Carruth | ae0cafe | 2018-08-23 06:06:38 +0000 | [diff] [blame] | 382 | "lowering them with a speculation blocking construct.", |
| 383 | [FeatureRetpolineIndirectCalls, |
| 384 | FeatureRetpolineIndirectBranches]>; |
Chandler Carruth | c58f216 | 2018-01-22 22:05:25 +0000 | [diff] [blame] | 385 | |
| 386 | // Rely on external thunks for the emitted retpoline calls. This allows users |
| 387 | // to provide their own custom thunk definitions in highly specialized |
| 388 | // environments such as a kernel that does boot-time hot patching. |
| 389 | def FeatureRetpolineExternalThunk |
| 390 | : SubtargetFeature< |
| 391 | "retpoline-external-thunk", "UseRetpolineExternalThunk", "true", |
Chandler Carruth | ae0cafe | 2018-08-23 06:06:38 +0000 | [diff] [blame] | 392 | "When lowering an indirect call or branch using a `retpoline`, rely " |
| 393 | "on the specified user provided thunk rather than emitting one " |
| 394 | "ourselves. Only has effect when combined with some other retpoline " |
| 395 | "feature.", [FeatureRetpolineIndirectCalls]>; |
Chandler Carruth | c58f216 | 2018-01-22 22:05:25 +0000 | [diff] [blame] | 396 | |
Gabor Buella | c8ded04 | 2018-05-01 10:01:16 +0000 | [diff] [blame] | 397 | // Direct Move instructions. |
| 398 | def FeatureMOVDIRI : SubtargetFeature<"movdiri", "HasMOVDIRI", "true", |
| 399 | "Support movdiri instruction">; |
| 400 | def FeatureMOVDIR64B : SubtargetFeature<"movdir64b", "HasMOVDIR64B", "true", |
| 401 | "Support movdir64b instruction">; |
| 402 | |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 403 | //===----------------------------------------------------------------------===// |
Craig Topper | 57c2815 | 2017-12-10 17:42:36 +0000 | [diff] [blame] | 404 | // Register File Description |
| 405 | //===----------------------------------------------------------------------===// |
| 406 | |
| 407 | include "X86RegisterInfo.td" |
| 408 | include "X86RegisterBanks.td" |
| 409 | |
| 410 | //===----------------------------------------------------------------------===// |
| 411 | // Instruction Descriptions |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 412 | //===----------------------------------------------------------------------===// |
| 413 | |
Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 414 | include "X86Schedule.td" |
Craig Topper | 57c2815 | 2017-12-10 17:42:36 +0000 | [diff] [blame] | 415 | include "X86InstrInfo.td" |
Andrea Di Biagio | b6022aa | 2018-07-19 16:42:15 +0000 | [diff] [blame] | 416 | include "X86SchedPredicates.td" |
Craig Topper | 57c2815 | 2017-12-10 17:42:36 +0000 | [diff] [blame] | 417 | |
| 418 | def X86InstrInfo : InstrInfo; |
| 419 | |
| 420 | //===----------------------------------------------------------------------===// |
| 421 | // X86 processors supported. |
| 422 | //===----------------------------------------------------------------------===// |
| 423 | |
| 424 | include "X86ScheduleAtom.td" |
| 425 | include "X86SchedSandyBridge.td" |
| 426 | include "X86SchedHaswell.td" |
| 427 | include "X86SchedBroadwell.td" |
| 428 | include "X86ScheduleSLM.td" |
| 429 | include "X86ScheduleZnver1.td" |
| 430 | include "X86ScheduleBtVer2.td" |
| 431 | include "X86SchedSkylakeClient.td" |
| 432 | include "X86SchedSkylakeServer.td" |
Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 433 | |
| 434 | def ProcIntelAtom : SubtargetFeature<"atom", "X86ProcFamily", "IntelAtom", |
| 435 | "Intel Atom processors">; |
Preston Gurd | 3fe264d | 2013-09-13 19:23:28 +0000 | [diff] [blame] | 436 | def ProcIntelSLM : SubtargetFeature<"slm", "X86ProcFamily", "IntelSLM", |
| 437 | "Intel Silvermont processors">; |
Michael Zuckerman | 4bcb9c3 | 2017-06-29 10:00:33 +0000 | [diff] [blame] | 438 | def ProcIntelGLM : SubtargetFeature<"glm", "X86ProcFamily", "IntelGLM", |
| 439 | "Intel Goldmont processors">; |
Gabor Buella | 8f1646b | 2018-04-16 07:47:35 +0000 | [diff] [blame] | 440 | def ProcIntelGLP : SubtargetFeature<"glp", "X86ProcFamily", "IntelGLP", |
| 441 | "Intel Goldmont Plus processors">; |
| 442 | def ProcIntelTRM : SubtargetFeature<"tremont", "X86ProcFamily", "IntelTRM", |
| 443 | "Intel Tremont processors">; |
Mohammed Agabaria | e9aebf2 | 2017-09-13 09:00:27 +0000 | [diff] [blame] | 444 | def ProcIntelHSW : SubtargetFeature<"haswell", "X86ProcFamily", |
| 445 | "IntelHaswell", "Intel Haswell processors">; |
| 446 | def ProcIntelBDW : SubtargetFeature<"broadwell", "X86ProcFamily", |
| 447 | "IntelBroadwell", "Intel Broadwell processors">; |
| 448 | def ProcIntelSKL : SubtargetFeature<"skylake", "X86ProcFamily", |
| 449 | "IntelSkylake", "Intel Skylake processors">; |
| 450 | def ProcIntelKNL : SubtargetFeature<"knl", "X86ProcFamily", |
| 451 | "IntelKNL", "Intel Knights Landing processors">; |
| 452 | def ProcIntelSKX : SubtargetFeature<"skx", "X86ProcFamily", |
| 453 | "IntelSKX", "Intel Skylake Server processors">; |
| 454 | def ProcIntelCNL : SubtargetFeature<"cannonlake", "X86ProcFamily", |
| 455 | "IntelCannonlake", "Intel Cannonlake processors">; |
Gabor Buella | 213edc4 | 2018-04-10 18:59:13 +0000 | [diff] [blame] | 456 | def ProcIntelICL : SubtargetFeature<"icelake-client", "X86ProcFamily", |
| 457 | "IntelIcelakeClient", "Intel Icelake processors">; |
| 458 | def ProcIntelICX : SubtargetFeature<"icelake-server", "X86ProcFamily", |
| 459 | "IntelIcelakeServer", "Intel Icelake Server processors">; |
Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 460 | |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 461 | class Proc<string Name, list<SubtargetFeature> Features> |
Andrew Trick | 87255e3 | 2012-07-07 04:00:00 +0000 | [diff] [blame] | 462 | : ProcessorModel<Name, GenericModel, Features>; |
Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 463 | |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 464 | def : Proc<"generic", [FeatureX87, FeatureSlowUAMem16]>; |
| 465 | def : Proc<"i386", [FeatureX87, FeatureSlowUAMem16]>; |
| 466 | def : Proc<"i486", [FeatureX87, FeatureSlowUAMem16]>; |
| 467 | def : Proc<"i586", [FeatureX87, FeatureSlowUAMem16]>; |
| 468 | def : Proc<"pentium", [FeatureX87, FeatureSlowUAMem16]>; |
| 469 | def : Proc<"pentium-mmx", [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>; |
Craig Topper | 3837322 | 2017-11-01 22:15:49 +0000 | [diff] [blame] | 470 | |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 471 | def : Proc<"i686", [FeatureX87, FeatureSlowUAMem16, FeatureCMOV]>; |
| 472 | def : Proc<"pentiumpro", [FeatureX87, FeatureSlowUAMem16, FeatureCMOV, |
| 473 | FeatureNOPL]>; |
Craig Topper | 3837322 | 2017-11-01 22:15:49 +0000 | [diff] [blame] | 474 | |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 475 | def : Proc<"pentium2", [FeatureX87, FeatureSlowUAMem16, FeatureMMX, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 476 | FeatureCMOV, FeatureFXSR, FeatureNOPL]>; |
Craig Topper | 3837322 | 2017-11-01 22:15:49 +0000 | [diff] [blame] | 477 | |
| 478 | foreach P = ["pentium3", "pentium3m"] in { |
| 479 | def : Proc<P, [FeatureX87, FeatureSlowUAMem16, FeatureMMX, FeatureSSE1, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 480 | FeatureFXSR, FeatureNOPL, FeatureCMOV]>; |
Craig Topper | 3837322 | 2017-11-01 22:15:49 +0000 | [diff] [blame] | 481 | } |
Mitch Bodart | e60465d | 2016-04-27 22:52:35 +0000 | [diff] [blame] | 482 | |
| 483 | // Enable the PostRAScheduler for SSE2 and SSE3 class cpus. |
| 484 | // The intent is to enable it for pentium4 which is the current default |
| 485 | // processor in a vanilla 32-bit clang compilation when no specific |
| 486 | // architecture is specified. This generally gives a nice performance |
| 487 | // increase on silvermont, with largely neutral behavior on other |
| 488 | // contemporary large core processors. |
| 489 | // pentium-m, pentium4m, prescott and nocona are included as a preventative |
| 490 | // measure to avoid performance surprises, in case clang's default cpu |
| 491 | // changes slightly. |
| 492 | |
| 493 | def : ProcessorModel<"pentium-m", GenericPostRAModel, |
| 494 | [FeatureX87, FeatureSlowUAMem16, FeatureMMX, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 495 | FeatureSSE2, FeatureFXSR, FeatureNOPL, FeatureCMOV]>; |
Mitch Bodart | e60465d | 2016-04-27 22:52:35 +0000 | [diff] [blame] | 496 | |
Craig Topper | 3837322 | 2017-11-01 22:15:49 +0000 | [diff] [blame] | 497 | foreach P = ["pentium4", "pentium4m"] in { |
| 498 | def : ProcessorModel<P, GenericPostRAModel, |
| 499 | [FeatureX87, FeatureSlowUAMem16, FeatureMMX, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 500 | FeatureSSE2, FeatureFXSR, FeatureNOPL, FeatureCMOV]>; |
Craig Topper | 3837322 | 2017-11-01 22:15:49 +0000 | [diff] [blame] | 501 | } |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 502 | |
Andrey Turetskiy | 958eb46 | 2016-04-01 10:16:15 +0000 | [diff] [blame] | 503 | // Intel Quark. |
| 504 | def : Proc<"lakemont", []>; |
| 505 | |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 506 | // Intel Core Duo. |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 507 | def : ProcessorModel<"yonah", SandyBridgeModel, |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 508 | [FeatureX87, FeatureSlowUAMem16, FeatureMMX, FeatureSSE3, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 509 | FeatureFXSR, FeatureNOPL, FeatureCMOV]>; |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 510 | |
| 511 | // NetBurst. |
Mitch Bodart | e60465d | 2016-04-27 22:52:35 +0000 | [diff] [blame] | 512 | def : ProcessorModel<"prescott", GenericPostRAModel, |
| 513 | [FeatureX87, FeatureSlowUAMem16, FeatureMMX, FeatureSSE3, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 514 | FeatureFXSR, FeatureNOPL, FeatureCMOV]>; |
Mitch Bodart | e60465d | 2016-04-27 22:52:35 +0000 | [diff] [blame] | 515 | def : ProcessorModel<"nocona", GenericPostRAModel, [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 516 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 517 | FeatureSlowUAMem16, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 518 | FeatureCMOV, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 519 | FeatureMMX, |
| 520 | FeatureSSE3, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 521 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 522 | FeatureNOPL, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 523 | Feature64Bit, |
Craig Topper | 2738117 | 2017-10-15 16:57:33 +0000 | [diff] [blame] | 524 | FeatureCMPXCHG16B |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 525 | ]>; |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 526 | |
| 527 | // Intel Core 2 Solo/Duo. |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 528 | def : ProcessorModel<"core2", SandyBridgeModel, [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 529 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 530 | FeatureSlowUAMem16, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 531 | FeatureCMOV, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 532 | FeatureMMX, |
| 533 | FeatureSSSE3, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 534 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 535 | FeatureNOPL, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 536 | Feature64Bit, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 537 | FeatureCMPXCHG16B, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 538 | FeatureLAHFSAHF, |
| 539 | FeatureMacroFusion |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 540 | ]>; |
| 541 | def : ProcessorModel<"penryn", SandyBridgeModel, [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 542 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 543 | FeatureSlowUAMem16, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 544 | FeatureCMOV, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 545 | FeatureMMX, |
| 546 | FeatureSSE41, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 547 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 548 | FeatureNOPL, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 549 | Feature64Bit, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 550 | FeatureCMPXCHG16B, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 551 | FeatureLAHFSAHF, |
| 552 | FeatureMacroFusion |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 553 | ]>; |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 554 | |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 555 | // Atom CPUs. |
| 556 | class BonnellProc<string Name> : ProcessorModel<Name, AtomModel, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 557 | ProcIntelAtom, |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 558 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 559 | FeatureSlowUAMem16, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 560 | FeatureCMOV, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 561 | FeatureMMX, |
| 562 | FeatureSSSE3, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 563 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 564 | FeatureNOPL, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 565 | Feature64Bit, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 566 | FeatureCMPXCHG16B, |
| 567 | FeatureMOVBE, |
Sanjay Patel | 53d1d8b | 2015-10-12 15:24:01 +0000 | [diff] [blame] | 568 | FeatureLEAForSP, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 569 | FeatureSlowDivide32, |
| 570 | FeatureSlowDivide64, |
Craig Topper | 62c47a2 | 2017-08-29 05:14:27 +0000 | [diff] [blame] | 571 | FeatureSlowTwoMemOps, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 572 | FeatureLEAUsesAG, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 573 | FeaturePadShortFunctions, |
| 574 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 575 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 576 | def : BonnellProc<"bonnell">; |
| 577 | def : BonnellProc<"atom">; // Pin the generic name to the baseline. |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 578 | |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 579 | class SilvermontProc<string Name> : ProcessorModel<Name, SLMModel, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 580 | ProcIntelSLM, |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 581 | FeatureX87, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 582 | FeatureCMOV, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 583 | FeatureMMX, |
| 584 | FeatureSSE42, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 585 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 586 | FeatureNOPL, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 587 | Feature64Bit, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 588 | FeatureCMPXCHG16B, |
| 589 | FeatureMOVBE, |
| 590 | FeaturePOPCNT, |
| 591 | FeaturePCLMUL, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 592 | FeatureSlowDivide64, |
Craig Topper | 62c47a2 | 2017-08-29 05:14:27 +0000 | [diff] [blame] | 593 | FeatureSlowTwoMemOps, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 594 | FeaturePRFCHW, |
| 595 | FeatureSlowLEA, |
| 596 | FeatureSlowIncDec, |
Zvi Rackover | 8bc7e4d | 2016-12-06 19:35:20 +0000 | [diff] [blame] | 597 | FeatureSlowPMULLD, |
Craig Topper | b207dd6 | 2018-01-26 19:34:14 +0000 | [diff] [blame] | 598 | FeatureRDRAND, |
Craig Topper | bc895a3 | 2018-04-19 19:25:24 +0000 | [diff] [blame] | 599 | FeatureLAHFSAHF, |
| 600 | FeaturePOPCNTFalseDeps |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 601 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 602 | def : SilvermontProc<"silvermont">; |
| 603 | def : SilvermontProc<"slm">; // Legacy alias. |
| 604 | |
Gabor Buella | 8f1646b | 2018-04-16 07:47:35 +0000 | [diff] [blame] | 605 | class ProcessorFeatures<list<SubtargetFeature> Inherited, |
| 606 | list<SubtargetFeature> NewFeatures> { |
| 607 | list<SubtargetFeature> Value = !listconcat(Inherited, NewFeatures); |
| 608 | } |
| 609 | |
| 610 | class ProcModel<string Name, SchedMachineModel Model, |
| 611 | list<SubtargetFeature> ProcFeatures, |
| 612 | list<SubtargetFeature> OtherFeatures> : |
| 613 | ProcessorModel<Name, Model, !listconcat(ProcFeatures, OtherFeatures)>; |
| 614 | |
| 615 | def GLMFeatures : ProcessorFeatures<[], [ |
Michael Zuckerman | 4bcb9c3 | 2017-06-29 10:00:33 +0000 | [diff] [blame] | 616 | FeatureX87, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 617 | FeatureCMOV, |
Michael Zuckerman | 4bcb9c3 | 2017-06-29 10:00:33 +0000 | [diff] [blame] | 618 | FeatureMMX, |
| 619 | FeatureSSE42, |
| 620 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 621 | FeatureNOPL, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 622 | Feature64Bit, |
Michael Zuckerman | 4bcb9c3 | 2017-06-29 10:00:33 +0000 | [diff] [blame] | 623 | FeatureCMPXCHG16B, |
| 624 | FeatureMOVBE, |
| 625 | FeaturePOPCNT, |
| 626 | FeaturePCLMUL, |
| 627 | FeatureAES, |
| 628 | FeaturePRFCHW, |
Craig Topper | 62c47a2 | 2017-08-29 05:14:27 +0000 | [diff] [blame] | 629 | FeatureSlowTwoMemOps, |
Michael Zuckerman | 4bcb9c3 | 2017-06-29 10:00:33 +0000 | [diff] [blame] | 630 | FeatureSlowLEA, |
| 631 | FeatureSlowIncDec, |
Michael Zuckerman | 4bcb9c3 | 2017-06-29 10:00:33 +0000 | [diff] [blame] | 632 | FeatureLAHFSAHF, |
| 633 | FeatureMPX, |
| 634 | FeatureSHA, |
Craig Topper | a4c5caf | 2017-07-04 05:33:19 +0000 | [diff] [blame] | 635 | FeatureRDRAND, |
Michael Zuckerman | 4bcb9c3 | 2017-06-29 10:00:33 +0000 | [diff] [blame] | 636 | FeatureRDSEED, |
| 637 | FeatureXSAVE, |
| 638 | FeatureXSAVEOPT, |
| 639 | FeatureXSAVEC, |
| 640 | FeatureXSAVES, |
Michael Zuckerman | ac1d20d | 2017-09-25 13:45:31 +0000 | [diff] [blame] | 641 | FeatureCLFLUSHOPT, |
| 642 | FeatureFSGSBase |
Michael Zuckerman | 4bcb9c3 | 2017-06-29 10:00:33 +0000 | [diff] [blame] | 643 | ]>; |
Gabor Buella | 8f1646b | 2018-04-16 07:47:35 +0000 | [diff] [blame] | 644 | |
| 645 | class GoldmontProc<string Name> : ProcModel<Name, SLMModel, |
Craig Topper | bc895a3 | 2018-04-19 19:25:24 +0000 | [diff] [blame] | 646 | GLMFeatures.Value, [ |
| 647 | ProcIntelGLM, |
| 648 | FeaturePOPCNTFalseDeps |
| 649 | ]>; |
Michael Zuckerman | 4bcb9c3 | 2017-06-29 10:00:33 +0000 | [diff] [blame] | 650 | def : GoldmontProc<"goldmont">; |
| 651 | |
Gabor Buella | a832b22 | 2018-05-10 07:26:05 +0000 | [diff] [blame] | 652 | def GLPFeatures : ProcessorFeatures<GLMFeatures.Value, [ |
| 653 | FeaturePTWRITE, |
Gabor Buella | 8f1646b | 2018-04-16 07:47:35 +0000 | [diff] [blame] | 654 | FeatureRDPID, |
| 655 | FeatureSGX |
| 656 | ]>; |
Gabor Buella | a832b22 | 2018-05-10 07:26:05 +0000 | [diff] [blame] | 657 | |
| 658 | class GoldmontPlusProc<string Name> : ProcModel<Name, SLMModel, |
| 659 | GLPFeatures.Value, [ |
| 660 | ProcIntelGLP |
| 661 | ]>; |
Gabor Buella | 8f1646b | 2018-04-16 07:47:35 +0000 | [diff] [blame] | 662 | def : GoldmontPlusProc<"goldmont-plus">; |
| 663 | |
| 664 | class TremontProc<string Name> : ProcModel<Name, SLMModel, |
Gabor Buella | a832b22 | 2018-05-10 07:26:05 +0000 | [diff] [blame] | 665 | GLPFeatures.Value, [ |
Gabor Buella | 8f1646b | 2018-04-16 07:47:35 +0000 | [diff] [blame] | 666 | ProcIntelTRM, |
| 667 | FeatureCLDEMOTE, |
| 668 | FeatureGFNI, |
Gabor Buella | c8ded04 | 2018-05-01 10:01:16 +0000 | [diff] [blame] | 669 | FeatureMOVDIRI, |
| 670 | FeatureMOVDIR64B, |
Gabor Buella | 31fa802 | 2018-04-20 18:42:47 +0000 | [diff] [blame] | 671 | FeatureWAITPKG |
Gabor Buella | 8f1646b | 2018-04-16 07:47:35 +0000 | [diff] [blame] | 672 | ]>; |
| 673 | def : TremontProc<"tremont">; |
| 674 | |
Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 675 | // "Arrandale" along with corei3 and corei5 |
Craig Topper | 3611d9b | 2015-03-30 06:31:11 +0000 | [diff] [blame] | 676 | class NehalemProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 677 | FeatureX87, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 678 | FeatureCMOV, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 679 | FeatureMMX, |
| 680 | FeatureSSE42, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 681 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 682 | FeatureNOPL, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 683 | Feature64Bit, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 684 | FeatureCMPXCHG16B, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 685 | FeaturePOPCNT, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 686 | FeatureLAHFSAHF, |
| 687 | FeatureMacroFusion |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 688 | ]>; |
Craig Topper | 3611d9b | 2015-03-30 06:31:11 +0000 | [diff] [blame] | 689 | def : NehalemProc<"nehalem">; |
| 690 | def : NehalemProc<"corei7">; |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 691 | |
Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 692 | // Westmere is a similar machine to nehalem with some additional features. |
| 693 | // Westmere is the corei3/i5/i7 path from nehalem to sandybridge |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 694 | class WestmereProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 695 | FeatureX87, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 696 | FeatureCMOV, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 697 | FeatureMMX, |
| 698 | FeatureSSE42, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 699 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 700 | FeatureNOPL, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 701 | Feature64Bit, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 702 | FeatureCMPXCHG16B, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 703 | FeaturePOPCNT, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 704 | FeaturePCLMUL, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 705 | FeatureLAHFSAHF, |
| 706 | FeatureMacroFusion |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 707 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 708 | def : WestmereProc<"westmere">; |
| 709 | |
Nate Begeman | 8b08f52 | 2010-12-10 00:26:57 +0000 | [diff] [blame] | 710 | // SSE is not listed here since llvm treats AVX as a reimplementation of SSE, |
| 711 | // rather than a superset. |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 712 | def SNBFeatures : ProcessorFeatures<[], [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 713 | FeatureX87, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 714 | FeatureCMOV, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 715 | FeatureMMX, |
| 716 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 717 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 718 | FeatureNOPL, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 719 | Feature64Bit, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 720 | FeatureCMPXCHG16B, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 721 | FeaturePOPCNT, |
Nikolai Bozhenov | 6bdf92c | 2017-01-12 19:34:15 +0000 | [diff] [blame] | 722 | FeatureSlowDivide64, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 723 | FeaturePCLMUL, |
| 724 | FeatureXSAVE, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 725 | FeatureXSAVEOPT, |
Nikolai Bozhenov | f679530 | 2016-08-04 12:47:28 +0000 | [diff] [blame] | 726 | FeatureLAHFSAHF, |
Lama Saba | 2ea271b | 2017-05-18 08:11:50 +0000 | [diff] [blame] | 727 | FeatureSlow3OpsLEA, |
Craig Topper | d88389a | 2017-02-21 06:39:13 +0000 | [diff] [blame] | 728 | FeatureFastScalarFSQRT, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 729 | FeatureFastSHLDRotate, |
Craig Topper | ef1f716 | 2017-08-30 05:00:35 +0000 | [diff] [blame] | 730 | FeatureSlowIncDec, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 731 | FeatureMacroFusion |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 732 | ]>; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 733 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 734 | class SandyBridgeProc<string Name> : ProcModel<Name, SandyBridgeModel, |
| 735 | SNBFeatures.Value, [ |
Marina Yatsina | 77a21db | 2018-01-22 10:07:01 +0000 | [diff] [blame] | 736 | FeatureSlowUAMem32, |
| 737 | FeaturePOPCNTFalseDeps |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 738 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 739 | def : SandyBridgeProc<"sandybridge">; |
| 740 | def : SandyBridgeProc<"corei7-avx">; // Legacy alias. |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 741 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 742 | def IVBFeatures : ProcessorFeatures<SNBFeatures.Value, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 743 | FeatureRDRAND, |
| 744 | FeatureF16C, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 745 | FeatureFSGSBase |
| 746 | ]>; |
| 747 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 748 | class IvyBridgeProc<string Name> : ProcModel<Name, SandyBridgeModel, |
| 749 | IVBFeatures.Value, [ |
Marina Yatsina | 77a21db | 2018-01-22 10:07:01 +0000 | [diff] [blame] | 750 | FeatureSlowUAMem32, |
| 751 | FeaturePOPCNTFalseDeps |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 752 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 753 | def : IvyBridgeProc<"ivybridge">; |
| 754 | def : IvyBridgeProc<"core-avx-i">; // Legacy alias. |
Craig Topper | 3657fe4 | 2011-10-14 03:21:46 +0000 | [diff] [blame] | 755 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 756 | def HSWFeatures : ProcessorFeatures<IVBFeatures.Value, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 757 | FeatureAVX2, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 758 | FeatureBMI, |
| 759 | FeatureBMI2, |
Clement Courbet | 203fc17 | 2017-04-21 09:20:50 +0000 | [diff] [blame] | 760 | FeatureERMSB, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 761 | FeatureFMA, |
Gabor Buella | d2f1ab1 | 2018-05-25 06:32:05 +0000 | [diff] [blame] | 762 | FeatureINVPCID, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 763 | FeatureLZCNT, |
Simon Pilgrim | fd5df63 | 2017-12-19 13:16:43 +0000 | [diff] [blame] | 764 | FeatureMOVBE, |
| 765 | FeatureFastVariableShuffle |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 766 | ]>; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 767 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 768 | class HaswellProc<string Name> : ProcModel<Name, HaswellModel, |
Mohammed Agabaria | e9aebf2 | 2017-09-13 09:00:27 +0000 | [diff] [blame] | 769 | HSWFeatures.Value, [ |
Marina Yatsina | 77a21db | 2018-01-22 10:07:01 +0000 | [diff] [blame] | 770 | ProcIntelHSW, |
| 771 | FeaturePOPCNTFalseDeps, |
| 772 | FeatureLZCNTFalseDeps |
Craig Topper | 54541c4 | 2017-10-13 16:04:08 +0000 | [diff] [blame] | 773 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 774 | def : HaswellProc<"haswell">; |
| 775 | def : HaswellProc<"core-avx2">; // Legacy alias. |
| 776 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 777 | def BDWFeatures : ProcessorFeatures<HSWFeatures.Value, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 778 | FeatureADX, |
Craig Topper | 67885f5 | 2017-12-22 02:41:12 +0000 | [diff] [blame] | 779 | FeatureRDSEED, |
| 780 | FeaturePRFCHW |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 781 | ]>; |
Gadi Haber | 323f2e1 | 2017-10-24 20:19:47 +0000 | [diff] [blame] | 782 | class BroadwellProc<string Name> : ProcModel<Name, BroadwellModel, |
Craig Topper | 54541c4 | 2017-10-13 16:04:08 +0000 | [diff] [blame] | 783 | BDWFeatures.Value, [ |
Marina Yatsina | 77a21db | 2018-01-22 10:07:01 +0000 | [diff] [blame] | 784 | ProcIntelBDW, |
| 785 | FeaturePOPCNTFalseDeps, |
| 786 | FeatureLZCNTFalseDeps |
Craig Topper | 54541c4 | 2017-10-13 16:04:08 +0000 | [diff] [blame] | 787 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 788 | def : BroadwellProc<"broadwell">; |
| 789 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 790 | def SKLFeatures : ProcessorFeatures<BDWFeatures.Value, [ |
Erich Keane | 911ddd6 | 2018-09-10 21:12:19 +0000 | [diff] [blame^] | 791 | FeatureAES, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 792 | FeatureMPX, |
Eric Christopher | 5829741 | 2017-03-29 07:40:44 +0000 | [diff] [blame] | 793 | FeatureRTM, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 794 | FeatureXSAVEC, |
| 795 | FeatureXSAVES, |
Nikolai Bozhenov | f679530 | 2016-08-04 12:47:28 +0000 | [diff] [blame] | 796 | FeatureCLFLUSHOPT, |
| 797 | FeatureFastVectorFSQRT |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 798 | ]>; |
| 799 | |
Gadi Haber | 6f8fbf4 | 2017-09-19 06:19:27 +0000 | [diff] [blame] | 800 | class SkylakeClientProc<string Name> : ProcModel<Name, SkylakeClientModel, |
Mohammed Agabaria | e9aebf2 | 2017-09-13 09:00:27 +0000 | [diff] [blame] | 801 | SKLFeatures.Value, [ |
Craig Topper | ea37e20 | 2017-11-25 18:09:37 +0000 | [diff] [blame] | 802 | ProcIntelSKL, |
Marina Yatsina | 77a21db | 2018-01-22 10:07:01 +0000 | [diff] [blame] | 803 | FeatureHasFastGather, |
Gabor Buella | 3eab22d | 2018-04-10 13:58:57 +0000 | [diff] [blame] | 804 | FeaturePOPCNTFalseDeps, |
| 805 | FeatureSGX |
Craig Topper | 5805fb3 | 2017-10-13 16:06:06 +0000 | [diff] [blame] | 806 | ]>; |
Sanjoy Das | aa63dc0 | 2016-02-21 17:12:03 +0000 | [diff] [blame] | 807 | def : SkylakeClientProc<"skylake">; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 808 | |
Craig Topper | 5d69291 | 2017-10-13 18:10:17 +0000 | [diff] [blame] | 809 | def KNLFeatures : ProcessorFeatures<IVBFeatures.Value, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 810 | FeatureAVX512, |
| 811 | FeatureERI, |
| 812 | FeatureCDI, |
| 813 | FeaturePFI, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 814 | FeaturePREFETCHWT1, |
| 815 | FeatureADX, |
| 816 | FeatureRDSEED, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 817 | FeatureMOVBE, |
| 818 | FeatureLZCNT, |
| 819 | FeatureBMI, |
| 820 | FeatureBMI2, |
Craig Topper | 67885f5 | 2017-12-22 02:41:12 +0000 | [diff] [blame] | 821 | FeatureFMA, |
| 822 | FeaturePRFCHW |
Craig Topper | 5d69291 | 2017-10-13 18:10:17 +0000 | [diff] [blame] | 823 | ]>; |
| 824 | |
| 825 | // FIXME: define KNL model |
| 826 | class KnightsLandingProc<string Name> : ProcModel<Name, HaswellModel, |
| 827 | KNLFeatures.Value, [ |
| 828 | ProcIntelKNL, |
Craig Topper | 62c47a2 | 2017-08-29 05:14:27 +0000 | [diff] [blame] | 829 | FeatureSlowTwoMemOps, |
Craig Topper | ea37e20 | 2017-11-25 18:09:37 +0000 | [diff] [blame] | 830 | FeatureFastPartialYMMorZMMWrite, |
| 831 | FeatureHasFastGather |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 832 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 833 | def : KnightsLandingProc<"knl">; |
Elena Demikhovsky | 8cfb43f | 2013-07-24 11:02:47 +0000 | [diff] [blame] | 834 | |
Craig Topper | 5d69291 | 2017-10-13 18:10:17 +0000 | [diff] [blame] | 835 | class KnightsMillProc<string Name> : ProcModel<Name, HaswellModel, |
| 836 | KNLFeatures.Value, [ |
| 837 | ProcIntelKNL, |
| 838 | FeatureSlowTwoMemOps, |
Craig Topper | 6fae2ee | 2017-10-25 17:10:32 +0000 | [diff] [blame] | 839 | FeatureFastPartialYMMorZMMWrite, |
Craig Topper | ea37e20 | 2017-11-25 18:09:37 +0000 | [diff] [blame] | 840 | FeatureHasFastGather, |
Craig Topper | 6fae2ee | 2017-10-25 17:10:32 +0000 | [diff] [blame] | 841 | FeatureVPOPCNTDQ |
Craig Topper | 5d69291 | 2017-10-13 18:10:17 +0000 | [diff] [blame] | 842 | ]>; |
| 843 | def : KnightsMillProc<"knm">; // TODO Add AVX5124FMAPS/AVX5124VNNIW features |
| 844 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 845 | def SKXFeatures : ProcessorFeatures<SKLFeatures.Value, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 846 | FeatureAVX512, |
| 847 | FeatureCDI, |
| 848 | FeatureDQI, |
| 849 | FeatureBWI, |
| 850 | FeatureVLX, |
Asaf Badouh | 5acf66f | 2015-12-15 13:35:29 +0000 | [diff] [blame] | 851 | FeaturePKU, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 852 | FeatureCLWB |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 853 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 854 | |
Gadi Haber | 684944b | 2017-10-08 12:52:54 +0000 | [diff] [blame] | 855 | class SkylakeServerProc<string Name> : ProcModel<Name, SkylakeServerModel, |
Mohammed Agabaria | e9aebf2 | 2017-09-13 09:00:27 +0000 | [diff] [blame] | 856 | SKXFeatures.Value, [ |
Craig Topper | ea37e20 | 2017-11-25 18:09:37 +0000 | [diff] [blame] | 857 | ProcIntelSKX, |
Craig Topper | a8f87a3 | 2018-01-29 21:56:48 +0000 | [diff] [blame] | 858 | FeatureHasFastGather, |
| 859 | FeaturePOPCNTFalseDeps |
Craig Topper | a1f9c9dd | 2017-10-15 16:41:15 +0000 | [diff] [blame] | 860 | ]>; |
Sanjoy Das | aa63dc0 | 2016-02-21 17:12:03 +0000 | [diff] [blame] | 861 | def : SkylakeServerProc<"skylake-avx512">; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 862 | def : SkylakeServerProc<"skx">; // Legacy alias. |
| 863 | |
Craig Topper | d710ada | 2018-02-21 00:15:48 +0000 | [diff] [blame] | 864 | def CNLFeatures : ProcessorFeatures<SKLFeatures.Value, [ |
| 865 | FeatureAVX512, |
| 866 | FeatureCDI, |
| 867 | FeatureDQI, |
| 868 | FeatureBWI, |
| 869 | FeatureVLX, |
| 870 | FeaturePKU, |
Elena Demikhovsky | 9242ea8 | 2016-01-18 13:00:31 +0000 | [diff] [blame] | 871 | FeatureVBMI, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 872 | FeatureIFMA, |
Gabor Buella | 3eab22d | 2018-04-10 13:58:57 +0000 | [diff] [blame] | 873 | FeatureSHA, |
| 874 | FeatureSGX |
Elena Demikhovsky | 9242ea8 | 2016-01-18 13:00:31 +0000 | [diff] [blame] | 875 | ]>; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 876 | |
Craig Topper | 9a94dfc | 2017-11-19 01:25:30 +0000 | [diff] [blame] | 877 | class CannonlakeProc<string Name> : ProcModel<Name, SkylakeServerModel, |
Mohammed Agabaria | e9aebf2 | 2017-09-13 09:00:27 +0000 | [diff] [blame] | 878 | CNLFeatures.Value, [ |
Craig Topper | ea37e20 | 2017-11-25 18:09:37 +0000 | [diff] [blame] | 879 | ProcIntelCNL, |
| 880 | FeatureHasFastGather |
Craig Topper | 5805fb3 | 2017-10-13 16:06:06 +0000 | [diff] [blame] | 881 | ]>; |
Elena Demikhovsky | 9242ea8 | 2016-01-18 13:00:31 +0000 | [diff] [blame] | 882 | def : CannonlakeProc<"cannonlake">; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 883 | |
Craig Topper | 81037f3 | 2017-11-19 01:12:00 +0000 | [diff] [blame] | 884 | def ICLFeatures : ProcessorFeatures<CNLFeatures.Value, [ |
Craig Topper | a890570 | 2017-11-21 21:05:18 +0000 | [diff] [blame] | 885 | FeatureBITALG, |
| 886 | FeatureVAES, |
| 887 | FeatureVBMI2, |
| 888 | FeatureVNNI, |
| 889 | FeatureVPCLMULQDQ, |
Coby Tayree | d8b17be | 2017-11-26 09:36:41 +0000 | [diff] [blame] | 890 | FeatureVPOPCNTDQ, |
Craig Topper | 55cfa89 | 2017-12-27 22:04:04 +0000 | [diff] [blame] | 891 | FeatureGFNI, |
Craig Topper | 84b26b9 | 2018-01-18 23:52:31 +0000 | [diff] [blame] | 892 | FeatureCLWB, |
| 893 | FeatureRDPID |
Craig Topper | 81037f3 | 2017-11-19 01:12:00 +0000 | [diff] [blame] | 894 | ]>; |
| 895 | |
Gabor Buella | 213edc4 | 2018-04-10 18:59:13 +0000 | [diff] [blame] | 896 | class IcelakeClientProc<string Name> : ProcModel<Name, SkylakeServerModel, |
| 897 | ICLFeatures.Value, [ |
Craig Topper | ea37e20 | 2017-11-25 18:09:37 +0000 | [diff] [blame] | 898 | ProcIntelICL, |
| 899 | FeatureHasFastGather |
Craig Topper | 81037f3 | 2017-11-19 01:12:00 +0000 | [diff] [blame] | 900 | ]>; |
Gabor Buella | 213edc4 | 2018-04-10 18:59:13 +0000 | [diff] [blame] | 901 | def : IcelakeClientProc<"icelake-client">; |
| 902 | |
| 903 | class IcelakeServerProc<string Name> : ProcModel<Name, SkylakeServerModel, |
| 904 | ICLFeatures.Value, [ |
| 905 | ProcIntelICX, |
Gabor Buella | 2b5e960 | 2018-05-08 06:47:36 +0000 | [diff] [blame] | 906 | FeaturePCONFIG, |
Gabor Buella | 2ef36f3 | 2018-04-11 20:01:57 +0000 | [diff] [blame] | 907 | FeatureWBNOINVD, |
Gabor Buella | 213edc4 | 2018-04-10 18:59:13 +0000 | [diff] [blame] | 908 | FeatureHasFastGather |
| 909 | ]>; |
| 910 | def : IcelakeServerProc<"icelake-server">; |
Craig Topper | 81037f3 | 2017-11-19 01:12:00 +0000 | [diff] [blame] | 911 | |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 912 | // AMD CPUs. |
Robert Khasanov | bfa0131 | 2014-07-21 14:54:21 +0000 | [diff] [blame] | 913 | |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 914 | def : Proc<"k6", [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>; |
| 915 | def : Proc<"k6-2", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>; |
| 916 | def : Proc<"k6-3", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>; |
Craig Topper | 3837322 | 2017-11-01 22:15:49 +0000 | [diff] [blame] | 917 | |
| 918 | foreach P = ["athlon", "athlon-tbird"] in { |
Craig Topper | b68a78b | 2018-08-26 18:29:27 +0000 | [diff] [blame] | 919 | def : Proc<P, [FeatureX87, FeatureSlowUAMem16, FeatureCMOV, Feature3DNowA, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 920 | FeatureNOPL, FeatureSlowSHLD]>; |
Craig Topper | 3837322 | 2017-11-01 22:15:49 +0000 | [diff] [blame] | 921 | } |
| 922 | |
| 923 | foreach P = ["athlon-4", "athlon-xp", "athlon-mp"] in { |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 924 | def : Proc<P, [FeatureX87, FeatureSlowUAMem16, FeatureCMOV, FeatureSSE1, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 925 | Feature3DNowA, FeatureFXSR, FeatureNOPL, FeatureSlowSHLD]>; |
Craig Topper | 3837322 | 2017-11-01 22:15:49 +0000 | [diff] [blame] | 926 | } |
| 927 | |
| 928 | foreach P = ["k8", "opteron", "athlon64", "athlon-fx"] in { |
| 929 | def : Proc<P, [FeatureX87, FeatureSlowUAMem16, FeatureSSE2, Feature3DNowA, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 930 | FeatureFXSR, FeatureNOPL, Feature64Bit, FeatureSlowSHLD, |
| 931 | FeatureCMOV]>; |
Craig Topper | 3837322 | 2017-11-01 22:15:49 +0000 | [diff] [blame] | 932 | } |
| 933 | |
| 934 | foreach P = ["k8-sse3", "opteron-sse3", "athlon64-sse3"] in { |
| 935 | def : Proc<P, [FeatureX87, FeatureSlowUAMem16, FeatureSSE3, Feature3DNowA, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 936 | FeatureFXSR, FeatureNOPL, FeatureCMPXCHG16B, FeatureSlowSHLD, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 937 | FeatureCMOV, Feature64Bit]>; |
Craig Topper | 3837322 | 2017-11-01 22:15:49 +0000 | [diff] [blame] | 938 | } |
| 939 | |
| 940 | foreach P = ["amdfam10", "barcelona"] in { |
| 941 | def : Proc<P, [FeatureX87, FeatureSSE4A, Feature3DNowA, FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 942 | FeatureNOPL, FeatureCMPXCHG16B, FeatureLZCNT, FeaturePOPCNT, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 943 | FeatureSlowSHLD, FeatureLAHFSAHF, FeatureCMOV, Feature64Bit]>; |
Craig Topper | 3837322 | 2017-11-01 22:15:49 +0000 | [diff] [blame] | 944 | } |
Sanjay Patel | 9e916dc | 2015-08-21 20:17:26 +0000 | [diff] [blame] | 945 | |
Benjamin Kramer | 077ae1d | 2012-01-10 11:50:02 +0000 | [diff] [blame] | 946 | // Bobcat |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 947 | def : Proc<"btver1", [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 948 | FeatureX87, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 949 | FeatureCMOV, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 950 | FeatureMMX, |
| 951 | FeatureSSSE3, |
| 952 | FeatureSSE4A, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 953 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 954 | FeatureNOPL, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 955 | Feature64Bit, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 956 | FeatureCMPXCHG16B, |
| 957 | FeaturePRFCHW, |
| 958 | FeatureLZCNT, |
| 959 | FeaturePOPCNT, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 960 | FeatureSlowSHLD, |
Simon Pilgrim | 02bdac5 | 2018-01-29 21:24:31 +0000 | [diff] [blame] | 961 | FeatureLAHFSAHF, |
| 962 | FeatureFast15ByteNOP |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 963 | ]>; |
Sanjay Patel | 1191adf | 2014-09-09 20:07:07 +0000 | [diff] [blame] | 964 | |
Benjamin Kramer | b44c427 | 2013-05-03 10:20:08 +0000 | [diff] [blame] | 965 | // Jaguar |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 966 | def : ProcessorModel<"btver2", BtVer2Model, [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 967 | FeatureX87, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 968 | FeatureCMOV, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 969 | FeatureMMX, |
| 970 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 971 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 972 | FeatureNOPL, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 973 | FeatureSSE4A, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 974 | Feature64Bit, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 975 | FeatureCMPXCHG16B, |
| 976 | FeaturePRFCHW, |
| 977 | FeatureAES, |
| 978 | FeaturePCLMUL, |
| 979 | FeatureBMI, |
| 980 | FeatureF16C, |
| 981 | FeatureMOVBE, |
| 982 | FeatureLZCNT, |
Pierre Gousseau | b6d652a | 2016-10-14 16:41:38 +0000 | [diff] [blame] | 983 | FeatureFastLZCNT, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 984 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 985 | FeatureXSAVE, |
| 986 | FeatureXSAVEOPT, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 987 | FeatureSlowSHLD, |
Yunzhong Gao | 0de36ec | 2016-02-12 23:37:57 +0000 | [diff] [blame] | 988 | FeatureLAHFSAHF, |
Simon Pilgrim | 02bdac5 | 2018-01-29 21:24:31 +0000 | [diff] [blame] | 989 | FeatureFast15ByteNOP, |
Amjad Aboud | 4f97751 | 2017-03-03 09:03:24 +0000 | [diff] [blame] | 990 | FeatureFastPartialYMMorZMMWrite |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 991 | ]>; |
Sanjay Patel | e57f3c0 | 2014-11-28 18:40:18 +0000 | [diff] [blame] | 992 | |
Benjamin Kramer | 077ae1d | 2012-01-10 11:50:02 +0000 | [diff] [blame] | 993 | // Bulldozer |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 994 | def : Proc<"bdver1", [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 995 | FeatureX87, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 996 | FeatureCMOV, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 997 | FeatureXOP, |
| 998 | FeatureFMA4, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 999 | Feature64Bit, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1000 | FeatureCMPXCHG16B, |
| 1001 | FeatureAES, |
| 1002 | FeaturePRFCHW, |
| 1003 | FeaturePCLMUL, |
| 1004 | FeatureMMX, |
| 1005 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 1006 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 1007 | FeatureNOPL, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1008 | FeatureSSE4A, |
| 1009 | FeatureLZCNT, |
| 1010 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 1011 | FeatureXSAVE, |
Simon Pilgrim | 99b925b | 2017-05-03 15:51:39 +0000 | [diff] [blame] | 1012 | FeatureLWP, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 1013 | FeatureSlowSHLD, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 1014 | FeatureLAHFSAHF, |
Simon Pilgrim | 02bdac5 | 2018-01-29 21:24:31 +0000 | [diff] [blame] | 1015 | FeatureFast11ByteNOP, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 1016 | FeatureMacroFusion |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1017 | ]>; |
Benjamin Kramer | b44c427 | 2013-05-03 10:20:08 +0000 | [diff] [blame] | 1018 | // Piledriver |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1019 | def : Proc<"bdver2", [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 1020 | FeatureX87, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 1021 | FeatureCMOV, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1022 | FeatureXOP, |
| 1023 | FeatureFMA4, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 1024 | Feature64Bit, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1025 | FeatureCMPXCHG16B, |
| 1026 | FeatureAES, |
| 1027 | FeaturePRFCHW, |
| 1028 | FeaturePCLMUL, |
| 1029 | FeatureMMX, |
| 1030 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 1031 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 1032 | FeatureNOPL, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1033 | FeatureSSE4A, |
| 1034 | FeatureF16C, |
| 1035 | FeatureLZCNT, |
| 1036 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 1037 | FeatureXSAVE, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1038 | FeatureBMI, |
| 1039 | FeatureTBM, |
Simon Pilgrim | 99b925b | 2017-05-03 15:51:39 +0000 | [diff] [blame] | 1040 | FeatureLWP, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1041 | FeatureFMA, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 1042 | FeatureSlowSHLD, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 1043 | FeatureLAHFSAHF, |
Simon Pilgrim | 02bdac5 | 2018-01-29 21:24:31 +0000 | [diff] [blame] | 1044 | FeatureFast11ByteNOP, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 1045 | FeatureMacroFusion |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1046 | ]>; |
Benjamin Kramer | d114def | 2013-11-04 10:29:20 +0000 | [diff] [blame] | 1047 | |
| 1048 | // Steamroller |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1049 | def : Proc<"bdver3", [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 1050 | FeatureX87, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 1051 | FeatureCMOV, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1052 | FeatureXOP, |
| 1053 | FeatureFMA4, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 1054 | Feature64Bit, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1055 | FeatureCMPXCHG16B, |
| 1056 | FeatureAES, |
| 1057 | FeaturePRFCHW, |
| 1058 | FeaturePCLMUL, |
| 1059 | FeatureMMX, |
| 1060 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 1061 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 1062 | FeatureNOPL, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1063 | FeatureSSE4A, |
| 1064 | FeatureF16C, |
| 1065 | FeatureLZCNT, |
| 1066 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 1067 | FeatureXSAVE, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1068 | FeatureBMI, |
| 1069 | FeatureTBM, |
Simon Pilgrim | 99b925b | 2017-05-03 15:51:39 +0000 | [diff] [blame] | 1070 | FeatureLWP, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1071 | FeatureFMA, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 1072 | FeatureXSAVEOPT, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1073 | FeatureSlowSHLD, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 1074 | FeatureFSGSBase, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 1075 | FeatureLAHFSAHF, |
Simon Pilgrim | 02bdac5 | 2018-01-29 21:24:31 +0000 | [diff] [blame] | 1076 | FeatureFast11ByteNOP, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 1077 | FeatureMacroFusion |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1078 | ]>; |
Benjamin Kramer | d114def | 2013-11-04 10:29:20 +0000 | [diff] [blame] | 1079 | |
Benjamin Kramer | 6004573 | 2014-05-02 15:47:07 +0000 | [diff] [blame] | 1080 | // Excavator |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1081 | def : Proc<"bdver4", [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 1082 | FeatureX87, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 1083 | FeatureCMOV, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1084 | FeatureMMX, |
| 1085 | FeatureAVX2, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 1086 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 1087 | FeatureNOPL, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1088 | FeatureXOP, |
| 1089 | FeatureFMA4, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 1090 | Feature64Bit, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1091 | FeatureCMPXCHG16B, |
| 1092 | FeatureAES, |
| 1093 | FeaturePRFCHW, |
| 1094 | FeaturePCLMUL, |
| 1095 | FeatureF16C, |
| 1096 | FeatureLZCNT, |
| 1097 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 1098 | FeatureXSAVE, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1099 | FeatureBMI, |
| 1100 | FeatureBMI2, |
| 1101 | FeatureTBM, |
Simon Pilgrim | 99b925b | 2017-05-03 15:51:39 +0000 | [diff] [blame] | 1102 | FeatureLWP, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1103 | FeatureFMA, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 1104 | FeatureXSAVEOPT, |
Simon Pilgrim | 381a0ad | 2016-07-24 16:00:53 +0000 | [diff] [blame] | 1105 | FeatureSlowSHLD, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 1106 | FeatureFSGSBase, |
Ashutosh Nema | 348af9c | 2016-05-18 11:59:12 +0000 | [diff] [blame] | 1107 | FeatureLAHFSAHF, |
Simon Pilgrim | 02bdac5 | 2018-01-29 21:24:31 +0000 | [diff] [blame] | 1108 | FeatureFast11ByteNOP, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 1109 | FeatureMWAITX, |
| 1110 | FeatureMacroFusion |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 1111 | ]>; |
Benjamin Kramer | 6004573 | 2014-05-02 15:47:07 +0000 | [diff] [blame] | 1112 | |
Craig Topper | 106b5b6 | 2017-07-19 02:45:14 +0000 | [diff] [blame] | 1113 | // Znver1 |
| 1114 | def: ProcessorModel<"znver1", Znver1Model, [ |
Craig Topper | d55b831 | 2017-01-10 06:01:16 +0000 | [diff] [blame] | 1115 | FeatureADX, |
| 1116 | FeatureAES, |
| 1117 | FeatureAVX2, |
| 1118 | FeatureBMI, |
| 1119 | FeatureBMI2, |
| 1120 | FeatureCLFLUSHOPT, |
Craig Topper | 50f3d14 | 2017-02-09 04:27:34 +0000 | [diff] [blame] | 1121 | FeatureCLZERO, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 1122 | FeatureCMOV, |
Craig Topper | b7b353b | 2018-08-30 06:01:05 +0000 | [diff] [blame] | 1123 | Feature64Bit, |
Craig Topper | d55b831 | 2017-01-10 06:01:16 +0000 | [diff] [blame] | 1124 | FeatureCMPXCHG16B, |
| 1125 | FeatureF16C, |
| 1126 | FeatureFMA, |
| 1127 | FeatureFSGSBase, |
| 1128 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 1129 | FeatureNOPL, |
Craig Topper | d55b831 | 2017-01-10 06:01:16 +0000 | [diff] [blame] | 1130 | FeatureFastLZCNT, |
| 1131 | FeatureLAHFSAHF, |
| 1132 | FeatureLZCNT, |
Simon Pilgrim | 02bdac5 | 2018-01-29 21:24:31 +0000 | [diff] [blame] | 1133 | FeatureFast15ByteNOP, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 1134 | FeatureMacroFusion, |
Craig Topper | d55b831 | 2017-01-10 06:01:16 +0000 | [diff] [blame] | 1135 | FeatureMMX, |
| 1136 | FeatureMOVBE, |
| 1137 | FeatureMWAITX, |
| 1138 | FeaturePCLMUL, |
| 1139 | FeaturePOPCNT, |
| 1140 | FeaturePRFCHW, |
| 1141 | FeatureRDRAND, |
| 1142 | FeatureRDSEED, |
| 1143 | FeatureSHA, |
Craig Topper | d55b831 | 2017-01-10 06:01:16 +0000 | [diff] [blame] | 1144 | FeatureSSE4A, |
| 1145 | FeatureSlowSHLD, |
| 1146 | FeatureX87, |
| 1147 | FeatureXSAVE, |
| 1148 | FeatureXSAVEC, |
| 1149 | FeatureXSAVEOPT, |
| 1150 | FeatureXSAVES]>; |
| 1151 | |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 1152 | def : Proc<"geode", [FeatureX87, FeatureSlowUAMem16, Feature3DNowA]>; |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 1153 | |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 1154 | def : Proc<"winchip-c6", [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>; |
| 1155 | def : Proc<"winchip2", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>; |
| 1156 | def : Proc<"c3", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>; |
| 1157 | def : Proc<"c3-2", [FeatureX87, FeatureSlowUAMem16, FeatureMMX, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 1158 | FeatureSSE1, FeatureFXSR, FeatureCMOV]>; |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 1159 | |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 1160 | // We also provide a generic 64-bit specific x86 processor model which tries to |
| 1161 | // be good for modern chips without enabling instruction set encodings past the |
| 1162 | // basic SSE2 and 64-bit ones. It disables slow things from any mainstream and |
| 1163 | // modern 64-bit x86 chip, and enables features that are generally beneficial. |
Michael Liao | 5bf9578 | 2014-12-04 05:20:33 +0000 | [diff] [blame] | 1164 | // |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 1165 | // We currently use the Sandy Bridge model as the default scheduling model as |
| 1166 | // we use it across Nehalem, Westmere, Sandy Bridge, and Ivy Bridge which |
| 1167 | // covers a huge swath of x86 processors. If there are specific scheduling |
| 1168 | // knobs which need to be tuned differently for AMD chips, we might consider |
| 1169 | // forming a common base for them. |
Chandler Carruth | 98c51cb | 2017-08-21 08:45:22 +0000 | [diff] [blame] | 1170 | def : ProcessorModel<"x86-64", SandyBridgeModel, [ |
| 1171 | FeatureX87, |
Craig Topper | 128915f | 2018-08-26 18:29:33 +0000 | [diff] [blame] | 1172 | FeatureCMOV, |
Chandler Carruth | 98c51cb | 2017-08-21 08:45:22 +0000 | [diff] [blame] | 1173 | FeatureMMX, |
| 1174 | FeatureSSE2, |
| 1175 | FeatureFXSR, |
Craig Topper | 505f38a | 2018-01-10 22:07:16 +0000 | [diff] [blame] | 1176 | FeatureNOPL, |
Chandler Carruth | 98c51cb | 2017-08-21 08:45:22 +0000 | [diff] [blame] | 1177 | Feature64Bit, |
| 1178 | FeatureSlow3OpsLEA, |
Craig Topper | 641e2af | 2017-08-30 04:34:48 +0000 | [diff] [blame] | 1179 | FeatureSlowIncDec, |
| 1180 | FeatureMacroFusion |
Chandler Carruth | 98c51cb | 2017-08-21 08:45:22 +0000 | [diff] [blame] | 1181 | ]>; |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 1182 | |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 1183 | //===----------------------------------------------------------------------===// |
Chris Lattner | 5d00a0b | 2007-02-26 18:17:14 +0000 | [diff] [blame] | 1184 | // Calling Conventions |
| 1185 | //===----------------------------------------------------------------------===// |
| 1186 | |
| 1187 | include "X86CallingConv.td" |
| 1188 | |
| 1189 | |
| 1190 | //===----------------------------------------------------------------------===// |
Jim Grosbach | 4cf25f5 | 2010-10-30 13:48:28 +0000 | [diff] [blame] | 1191 | // Assembly Parser |
Chris Lattner | 5d00a0b | 2007-02-26 18:17:14 +0000 | [diff] [blame] | 1192 | //===----------------------------------------------------------------------===// |
| 1193 | |
Devang Patel | 85d684a | 2012-01-09 19:13:28 +0000 | [diff] [blame] | 1194 | def ATTAsmParserVariant : AsmParserVariant { |
Daniel Dunbar | 0033199 | 2009-07-29 00:02:19 +0000 | [diff] [blame] | 1195 | int Variant = 0; |
Daniel Dunbar | e431871 | 2009-08-11 20:59:47 +0000 | [diff] [blame] | 1196 | |
Chad Rosier | 9f7a221 | 2013-04-18 22:35:36 +0000 | [diff] [blame] | 1197 | // Variant name. |
| 1198 | string Name = "att"; |
| 1199 | |
Daniel Dunbar | e431871 | 2009-08-11 20:59:47 +0000 | [diff] [blame] | 1200 | // Discard comments in assembly strings. |
| 1201 | string CommentDelimiter = "#"; |
| 1202 | |
| 1203 | // Recognize hard coded registers. |
| 1204 | string RegisterPrefix = "%"; |
Daniel Dunbar | 0033199 | 2009-07-29 00:02:19 +0000 | [diff] [blame] | 1205 | } |
| 1206 | |
Devang Patel | 67bf992a | 2012-01-10 17:51:54 +0000 | [diff] [blame] | 1207 | def IntelAsmParserVariant : AsmParserVariant { |
| 1208 | int Variant = 1; |
| 1209 | |
Chad Rosier | 9f7a221 | 2013-04-18 22:35:36 +0000 | [diff] [blame] | 1210 | // Variant name. |
| 1211 | string Name = "intel"; |
| 1212 | |
Devang Patel | 67bf992a | 2012-01-10 17:51:54 +0000 | [diff] [blame] | 1213 | // Discard comments in assembly strings. |
| 1214 | string CommentDelimiter = ";"; |
| 1215 | |
| 1216 | // Recognize hard coded registers. |
| 1217 | string RegisterPrefix = ""; |
| 1218 | } |
| 1219 | |
Jim Grosbach | 4cf25f5 | 2010-10-30 13:48:28 +0000 | [diff] [blame] | 1220 | //===----------------------------------------------------------------------===// |
| 1221 | // Assembly Printers |
| 1222 | //===----------------------------------------------------------------------===// |
| 1223 | |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 1224 | // The X86 target supports two different syntaxes for emitting machine code. |
| 1225 | // This is controlled by the -x86-asm-syntax={att|intel} |
| 1226 | def ATTAsmWriter : AsmWriter { |
Chris Lattner | 1cbd3de | 2009-09-13 19:30:11 +0000 | [diff] [blame] | 1227 | string AsmWriterClassName = "ATTInstPrinter"; |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 1228 | int Variant = 0; |
| 1229 | } |
| 1230 | def IntelAsmWriter : AsmWriter { |
Chris Lattner | 13306a1 | 2009-09-20 07:47:59 +0000 | [diff] [blame] | 1231 | string AsmWriterClassName = "IntelInstPrinter"; |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 1232 | int Variant = 1; |
| 1233 | } |
| 1234 | |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 1235 | def X86 : Target { |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 1236 | // Information about the instructions... |
Chris Lattner | 2551080 | 2003-08-04 04:59:56 +0000 | [diff] [blame] | 1237 | let InstructionSet = X86InstrInfo; |
Devang Patel | 67bf992a | 2012-01-10 17:51:54 +0000 | [diff] [blame] | 1238 | let AssemblyParserVariants = [ATTAsmParserVariant, IntelAsmParserVariant]; |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 1239 | let AssemblyWriters = [ATTAsmWriter, IntelAsmWriter]; |
Geoff Berry | f8bf2ec | 2018-02-23 18:25:08 +0000 | [diff] [blame] | 1240 | let AllowRegisterRenaming = 1; |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 1241 | } |
Clement Courbet | b449379 | 2018-04-10 08:16:37 +0000 | [diff] [blame] | 1242 | |
| 1243 | //===----------------------------------------------------------------------===// |
| 1244 | // Pfm Counters |
| 1245 | //===----------------------------------------------------------------------===// |
| 1246 | |
| 1247 | include "X86PfmCounters.td" |