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