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]>; |
Evan Cheng | 4c91aa3 | 2009-01-02 05:35:45 +0000 | [diff] [blame] | 98 | def FeatureSlowBTMem : SubtargetFeature<"slow-bt-mem", "IsBTMemSlow", "true", |
| 99 | "Bit testing of memory is slow">; |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 100 | def FeatureSlowSHLD : SubtargetFeature<"slow-shld", "IsSHLDSlow", "true", |
| 101 | "SHLD instruction is slow">; |
Zvi Rackover | 8bc7e4d | 2016-12-06 19:35:20 +0000 | [diff] [blame] | 102 | def FeatureSlowPMULLD : SubtargetFeature<"slow-pmulld", "IsPMULLDSlow", "true", |
| 103 | "PMULLD instruction is slow">; |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 104 | // FIXME: This should not apply to CPUs that do not have SSE. |
| 105 | def FeatureSlowUAMem16 : SubtargetFeature<"slow-unaligned-mem-16", |
| 106 | "IsUAMem16Slow", "true", |
| 107 | "Slow unaligned 16-byte memory access">; |
Sanjay Patel | 501890e | 2014-11-21 17:40:04 +0000 | [diff] [blame] | 108 | def FeatureSlowUAMem32 : SubtargetFeature<"slow-unaligned-mem-32", |
Sanjay Patel | 9e916dc | 2015-08-21 20:17:26 +0000 | [diff] [blame] | 109 | "IsUAMem32Slow", "true", |
| 110 | "Slow unaligned 32-byte memory access">; |
Stefanus Du Toit | 96180b5 | 2009-05-26 21:04:35 +0000 | [diff] [blame] | 111 | def FeatureSSE4A : SubtargetFeature<"sse4a", "HasSSE4A", "true", |
Craig Topper | a5d1fc2 | 2011-12-30 07:16:00 +0000 | [diff] [blame] | 112 | "Support SSE 4a instructions", |
| 113 | [FeatureSSE3]>; |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 114 | |
Craig Topper | f287a45 | 2012-01-09 09:02:13 +0000 | [diff] [blame] | 115 | def FeatureAVX : SubtargetFeature<"avx", "X86SSELevel", "AVX", |
| 116 | "Enable AVX instructions", |
| 117 | [FeatureSSE42]>; |
| 118 | def FeatureAVX2 : SubtargetFeature<"avx2", "X86SSELevel", "AVX2", |
Craig Topper | 228d913 | 2011-10-30 19:57:21 +0000 | [diff] [blame] | 119 | "Enable AVX2 instructions", |
| 120 | [FeatureAVX]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 121 | def FeatureAVX512 : SubtargetFeature<"avx512f", "X86SSELevel", "AVX512F", |
Elena Demikhovsky | 8cfb43f | 2013-07-24 11:02:47 +0000 | [diff] [blame] | 122 | "Enable AVX-512 instructions", |
| 123 | [FeatureAVX2]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 124 | def FeatureERI : SubtargetFeature<"avx512er", "HasERI", "true", |
Elena Demikhovsky | 003e7d7 | 2013-07-28 08:28:38 +0000 | [diff] [blame] | 125 | "Enable AVX-512 Exponential and Reciprocal Instructions", |
| 126 | [FeatureAVX512]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 127 | def FeatureCDI : SubtargetFeature<"avx512cd", "HasCDI", "true", |
Elena Demikhovsky | 003e7d7 | 2013-07-28 08:28:38 +0000 | [diff] [blame] | 128 | "Enable AVX-512 Conflict Detection Instructions", |
| 129 | [FeatureAVX512]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 130 | def FeaturePFI : SubtargetFeature<"avx512pf", "HasPFI", "true", |
Elena Demikhovsky | 003e7d7 | 2013-07-28 08:28:38 +0000 | [diff] [blame] | 131 | "Enable AVX-512 PreFetch Instructions", |
| 132 | [FeatureAVX512]>; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 133 | def FeaturePREFETCHWT1 : SubtargetFeature<"prefetchwt1", "HasPFPREFETCHWT1", |
| 134 | "true", |
| 135 | "Prefetch with Intent to Write and T1 Hint">; |
Robert Khasanov | bfa0131 | 2014-07-21 14:54:21 +0000 | [diff] [blame] | 136 | def FeatureDQI : SubtargetFeature<"avx512dq", "HasDQI", "true", |
| 137 | "Enable AVX-512 Doubleword and Quadword Instructions", |
| 138 | [FeatureAVX512]>; |
| 139 | def FeatureBWI : SubtargetFeature<"avx512bw", "HasBWI", "true", |
| 140 | "Enable AVX-512 Byte and Word Instructions", |
| 141 | [FeatureAVX512]>; |
| 142 | def FeatureVLX : SubtargetFeature<"avx512vl", "HasVLX", "true", |
| 143 | "Enable AVX-512 Vector Length eXtensions", |
| 144 | [FeatureAVX512]>; |
Michael Zuckerman | 97b6a692 | 2016-01-17 13:42:12 +0000 | [diff] [blame] | 145 | def FeatureVBMI : SubtargetFeature<"avx512vbmi", "HasVBMI", "true", |
Craig Topper | 5c842be | 2016-11-09 04:50:48 +0000 | [diff] [blame] | 146 | "Enable AVX-512 Vector Byte Manipulation Instructions", |
| 147 | [FeatureBWI]>; |
Craig Topper | 3bb3f73 | 2016-02-08 01:23:15 +0000 | [diff] [blame] | 148 | def FeatureIFMA : SubtargetFeature<"avx512ifma", "HasIFMA", "true", |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 149 | "Enable AVX-512 Integer Fused Multiple-Add", |
| 150 | [FeatureAVX512]>; |
Asaf Badouh | 5acf66f | 2015-12-15 13:35:29 +0000 | [diff] [blame] | 151 | def FeaturePKU : SubtargetFeature<"pku", "HasPKU", "true", |
| 152 | "Enable protection keys">; |
Benjamin Kramer | a0396e4 | 2012-05-31 14:34:17 +0000 | [diff] [blame] | 153 | def FeaturePCLMUL : SubtargetFeature<"pclmul", "HasPCLMUL", "true", |
| 154 | "Enable packed carry-less multiplication instructions", |
Craig Topper | 29dd148 | 2012-05-01 05:28:32 +0000 | [diff] [blame] | 155 | [FeatureSSE2]>; |
Craig Topper | 79dbb0c | 2012-06-03 18:58:46 +0000 | [diff] [blame] | 156 | def FeatureFMA : SubtargetFeature<"fma", "HasFMA", "true", |
Craig Topper | e1bd051 | 2011-12-29 19:46:19 +0000 | [diff] [blame] | 157 | "Enable three-operand fused multiple-add", |
| 158 | [FeatureAVX]>; |
David Greene | 8f6f72c | 2009-06-26 22:46:54 +0000 | [diff] [blame] | 159 | def FeatureFMA4 : SubtargetFeature<"fma4", "HasFMA4", "true", |
Craig Topper | a5d1fc2 | 2011-12-30 07:16:00 +0000 | [diff] [blame] | 160 | "Enable four-operand fused multiple-add", |
Craig Topper | bae0e9e | 2012-05-01 06:54:48 +0000 | [diff] [blame] | 161 | [FeatureAVX, FeatureSSE4A]>; |
Craig Topper | a5d1fc2 | 2011-12-30 07:16:00 +0000 | [diff] [blame] | 162 | def FeatureXOP : SubtargetFeature<"xop", "HasXOP", "true", |
Craig Topper | 43518cc | 2012-05-01 05:41:41 +0000 | [diff] [blame] | 163 | "Enable XOP instructions", |
Anitha Boyapati | af3e983 | 2012-08-16 04:04:02 +0000 | [diff] [blame] | 164 | [FeatureFMA4]>; |
Sanjay Patel | ffd039b | 2015-02-03 17:13:04 +0000 | [diff] [blame] | 165 | def FeatureSSEUnalignedMem : SubtargetFeature<"sse-unaligned-mem", |
| 166 | "HasSSEUnalignedMem", "true", |
| 167 | "Allow unaligned memory operands with SSE instructions">; |
Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 168 | def FeatureAES : SubtargetFeature<"aes", "HasAES", "true", |
Craig Topper | 29dd148 | 2012-05-01 05:28:32 +0000 | [diff] [blame] | 169 | "Enable AES instructions", |
| 170 | [FeatureSSE2]>; |
Yunzhong Gao | dd36e93 | 2013-09-24 18:21:52 +0000 | [diff] [blame] | 171 | def FeatureTBM : SubtargetFeature<"tbm", "HasTBM", "true", |
| 172 | "Enable TBM instructions">; |
Craig Topper | 786bdb9 | 2011-10-03 17:28:23 +0000 | [diff] [blame] | 173 | def FeatureMOVBE : SubtargetFeature<"movbe", "HasMOVBE", "true", |
| 174 | "Support MOVBE instruction">; |
Rafael Espindola | 94a2c56 | 2013-08-23 20:21:34 +0000 | [diff] [blame] | 175 | def FeatureRDRAND : SubtargetFeature<"rdrnd", "HasRDRAND", "true", |
Craig Topper | 786bdb9 | 2011-10-03 17:28:23 +0000 | [diff] [blame] | 176 | "Support RDRAND instruction">; |
Craig Topper | fe9179f | 2011-10-09 07:31:39 +0000 | [diff] [blame] | 177 | def FeatureF16C : SubtargetFeature<"f16c", "HasF16C", "true", |
Craig Topper | a6d204e | 2013-09-16 04:29:58 +0000 | [diff] [blame] | 178 | "Support 16-bit floating point conversion instructions", |
| 179 | [FeatureAVX]>; |
Craig Topper | 228d913 | 2011-10-30 19:57:21 +0000 | [diff] [blame] | 180 | def FeatureFSGSBase : SubtargetFeature<"fsgsbase", "HasFSGSBase", "true", |
| 181 | "Support FS/GS Base instructions">; |
Craig Topper | 271064e | 2011-10-11 06:44:02 +0000 | [diff] [blame] | 182 | def FeatureLZCNT : SubtargetFeature<"lzcnt", "HasLZCNT", "true", |
| 183 | "Support LZCNT instruction">; |
Craig Topper | 3657fe4 | 2011-10-14 03:21:46 +0000 | [diff] [blame] | 184 | def FeatureBMI : SubtargetFeature<"bmi", "HasBMI", "true", |
| 185 | "Support BMI instructions">; |
Craig Topper | aea148c | 2011-10-16 07:55:05 +0000 | [diff] [blame] | 186 | def FeatureBMI2 : SubtargetFeature<"bmi2", "HasBMI2", "true", |
| 187 | "Support BMI2 instructions">; |
Michael Liao | 73cffdd | 2012-11-08 07:28:54 +0000 | [diff] [blame] | 188 | def FeatureRTM : SubtargetFeature<"rtm", "HasRTM", "true", |
| 189 | "Support RTM instructions">; |
Michael Liao | e344ec9 | 2013-03-26 22:46:02 +0000 | [diff] [blame] | 190 | def FeatureHLE : SubtargetFeature<"hle", "HasHLE", "true", |
| 191 | "Support HLE">; |
Kay Tiong Khoo | f809c64 | 2013-02-14 19:08:21 +0000 | [diff] [blame] | 192 | def FeatureADX : SubtargetFeature<"adx", "HasADX", "true", |
| 193 | "Support ADX instructions">; |
Ben Langmuir | 1650175 | 2013-09-12 15:51:31 +0000 | [diff] [blame] | 194 | def FeatureSHA : SubtargetFeature<"sha", "HasSHA", "true", |
| 195 | "Enable SHA instructions", |
| 196 | [FeatureSSE2]>; |
Michael Liao | 5173ee0 | 2013-03-26 17:47:11 +0000 | [diff] [blame] | 197 | def FeaturePRFCHW : SubtargetFeature<"prfchw", "HasPRFCHW", "true", |
| 198 | "Support PRFCHW instructions">; |
Michael Liao | a486a11 | 2013-03-28 23:41:26 +0000 | [diff] [blame] | 199 | def FeatureRDSEED : SubtargetFeature<"rdseed", "HasRDSEED", "true", |
| 200 | "Support RDSEED instruction">; |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 201 | def FeatureLAHFSAHF : SubtargetFeature<"sahf", "HasLAHFSAHF", "true", |
| 202 | "Support LAHF and SAHF instructions">; |
Ashutosh Nema | 348af9c | 2016-05-18 11:59:12 +0000 | [diff] [blame] | 203 | def FeatureMWAITX : SubtargetFeature<"mwaitx", "HasMWAITX", "true", |
| 204 | "Enable MONITORX/MWAITX timer functionality">; |
Craig Topper | 50f3d14 | 2017-02-09 04:27:34 +0000 | [diff] [blame] | 205 | def FeatureCLZERO : SubtargetFeature<"clzero", "HasCLZERO", "true", |
| 206 | "Enable Cache Line Zero">; |
Elena Demikhovsky | f7e641c | 2015-06-03 10:30:57 +0000 | [diff] [blame] | 207 | def FeatureMPX : SubtargetFeature<"mpx", "HasMPX", "true", |
| 208 | "Support MPX instructions">; |
Sanjay Patel | 53d1d8b | 2015-10-12 15:24:01 +0000 | [diff] [blame] | 209 | def FeatureLEAForSP : SubtargetFeature<"lea-sp", "UseLeaForSP", "true", |
Evan Cheng | 1b81fdd | 2012-02-07 22:50:41 +0000 | [diff] [blame] | 210 | "Use LEA for adjusting the stack pointer">; |
Alexey Volkov | fd1731d | 2014-11-21 11:19:34 +0000 | [diff] [blame] | 211 | def FeatureSlowDivide32 : SubtargetFeature<"idivl-to-divb", |
| 212 | "HasSlowDivide32", "true", |
| 213 | "Use 8-bit divide for positive values less than 256">; |
Nikolai Bozhenov | 6bdf92c | 2017-01-12 19:34:15 +0000 | [diff] [blame] | 214 | def FeatureSlowDivide64 : SubtargetFeature<"idivq-to-divl", |
Alexey Volkov | fd1731d | 2014-11-21 11:19:34 +0000 | [diff] [blame] | 215 | "HasSlowDivide64", "true", |
Nikolai Bozhenov | 6bdf92c | 2017-01-12 19:34:15 +0000 | [diff] [blame] | 216 | "Use 32-bit divide for positive values less than 2^32">; |
Preston Gurd | a01daac | 2013-01-08 18:27:24 +0000 | [diff] [blame] | 217 | def FeaturePadShortFunctions : SubtargetFeature<"pad-short-functions", |
| 218 | "PadShortFunctions", "true", |
| 219 | "Pad short functions">; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 220 | def FeatureINVPCID : SubtargetFeature<"invpcid", "HasInvPCId", "true", |
| 221 | "Invalidate Process-Context Identifier">; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 222 | def FeatureSMAP : SubtargetFeature<"smap", "HasSMAP", "true", |
| 223 | "Supervisor Mode Access Protection">; |
| 224 | def FeatureSGX : SubtargetFeature<"sgx", "HasSGX", "true", |
| 225 | "Enable Software Guard Extensions">; |
| 226 | def FeatureCLFLUSHOPT : SubtargetFeature<"clflushopt", "HasCLFLUSHOPT", "true", |
| 227 | "Flush A Cache Line Optimized">; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 228 | def FeatureCLWB : SubtargetFeature<"clwb", "HasCLWB", "true", |
| 229 | "Cache Line Write Back">; |
Michael Kuperstein | 454d145 | 2015-07-23 12:23:45 +0000 | [diff] [blame] | 230 | // TODO: This feature ought to be renamed. |
Sean Silva | e1c6b54 | 2015-07-27 00:46:59 +0000 | [diff] [blame] | 231 | // What it really refers to are CPUs for which certain instructions |
| 232 | // (which ones besides the example below?) are microcoded. |
Michael Kuperstein | 454d145 | 2015-07-23 12:23:45 +0000 | [diff] [blame] | 233 | // The best examples of this are the memory forms of CALL and PUSH |
| 234 | // instructions, which should be avoided in favor of a MOV + register CALL/PUSH. |
Preston Gurd | 663e6f9 | 2013-03-27 19:14:02 +0000 | [diff] [blame] | 235 | def FeatureCallRegIndirect : SubtargetFeature<"call-reg-indirect", |
| 236 | "CallRegIndirect", "true", |
| 237 | "Call register indirect">; |
Preston Gurd | 8b7ab4b | 2013-04-25 20:29:37 +0000 | [diff] [blame] | 238 | def FeatureLEAUsesAG : SubtargetFeature<"lea-uses-ag", "LEAUsesAG", "true", |
| 239 | "LEA instruction needs inputs at AG stage">; |
Alexey Volkov | 6226de6 | 2014-05-20 08:55:50 +0000 | [diff] [blame] | 240 | def FeatureSlowLEA : SubtargetFeature<"slow-lea", "SlowLEA", "true", |
| 241 | "LEA instruction with certain arguments is slow">; |
Alexey Volkov | 5260dba | 2014-06-09 11:40:41 +0000 | [diff] [blame] | 242 | def FeatureSlowIncDec : SubtargetFeature<"slow-incdec", "SlowIncDec", "true", |
| 243 | "INC and DEC instructions are slower than ADD and SUB">; |
Eric Christopher | 824f42f | 2015-05-12 01:26:05 +0000 | [diff] [blame] | 244 | def FeatureSoftFloat |
| 245 | : SubtargetFeature<"soft-float", "UseSoftFloat", "true", |
| 246 | "Use software floating point features.">; |
Yunzhong Gao | 0de36ec | 2016-02-12 23:37:57 +0000 | [diff] [blame] | 247 | // On at least some AMD processors, there is no performance hazard to writing |
| 248 | // only the lower parts of a YMM register without clearing the upper part. |
| 249 | def FeatureFastPartialYMMWrite |
| 250 | : SubtargetFeature<"fast-partial-ymm-write", "HasFastPartialYMMWrite", |
| 251 | "true", "Partial writes to YMM registers are fast">; |
Nikolai Bozhenov | f679530 | 2016-08-04 12:47:28 +0000 | [diff] [blame] | 252 | // FeatureFastScalarFSQRT should be enabled if scalar FSQRT has shorter latency |
| 253 | // than the corresponding NR code. FeatureFastVectorFSQRT should be enabled if |
| 254 | // vector FSQRT has higher throughput than the corresponding NR code. |
| 255 | // The idea is that throughput bound code is likely to be vectorized, so for |
| 256 | // vectorized code we should care about the throughput of SQRT operations. |
| 257 | // But if the code is scalar that probably means that the code has some kind of |
| 258 | // dependency and we should care more about reducing the latency. |
| 259 | def FeatureFastScalarFSQRT |
| 260 | : SubtargetFeature<"fast-scalar-fsqrt", "HasFastScalarFSQRT", |
| 261 | "true", "Scalar SQRT is fast (disable Newton-Raphson)">; |
| 262 | def FeatureFastVectorFSQRT |
| 263 | : SubtargetFeature<"fast-vector-fsqrt", "HasFastVectorFSQRT", |
| 264 | "true", "Vector SQRT is fast (disable Newton-Raphson)">; |
Pierre Gousseau | b6d652a | 2016-10-14 16:41:38 +0000 | [diff] [blame] | 265 | // If lzcnt has equivalent latency/throughput to most simple integer ops, it can |
| 266 | // be used to replace test/set sequences. |
| 267 | def FeatureFastLZCNT |
| 268 | : SubtargetFeature< |
| 269 | "fast-lzcnt", "HasFastLZCNT", "true", |
| 270 | "LZCNT instructions are as fast as most simple integer ops">; |
David Greene | 8f6f72c | 2009-06-26 22:46:54 +0000 | [diff] [blame] | 271 | |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 272 | //===----------------------------------------------------------------------===// |
| 273 | // X86 processors supported. |
| 274 | //===----------------------------------------------------------------------===// |
| 275 | |
Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 276 | include "X86Schedule.td" |
| 277 | |
| 278 | def ProcIntelAtom : SubtargetFeature<"atom", "X86ProcFamily", "IntelAtom", |
| 279 | "Intel Atom processors">; |
Preston Gurd | 3fe264d | 2013-09-13 19:23:28 +0000 | [diff] [blame] | 280 | def ProcIntelSLM : SubtargetFeature<"slm", "X86ProcFamily", "IntelSLM", |
| 281 | "Intel Silvermont processors">; |
Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 282 | |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 283 | class Proc<string Name, list<SubtargetFeature> Features> |
Andrew Trick | 87255e3 | 2012-07-07 04:00:00 +0000 | [diff] [blame] | 284 | : ProcessorModel<Name, GenericModel, Features>; |
Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 285 | |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 286 | def : Proc<"generic", [FeatureX87, FeatureSlowUAMem16]>; |
| 287 | def : Proc<"i386", [FeatureX87, FeatureSlowUAMem16]>; |
| 288 | def : Proc<"i486", [FeatureX87, FeatureSlowUAMem16]>; |
| 289 | def : Proc<"i586", [FeatureX87, FeatureSlowUAMem16]>; |
| 290 | def : Proc<"pentium", [FeatureX87, FeatureSlowUAMem16]>; |
| 291 | def : Proc<"pentium-mmx", [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>; |
| 292 | def : Proc<"i686", [FeatureX87, FeatureSlowUAMem16]>; |
| 293 | def : Proc<"pentiumpro", [FeatureX87, FeatureSlowUAMem16, FeatureCMOV]>; |
| 294 | def : Proc<"pentium2", [FeatureX87, FeatureSlowUAMem16, FeatureMMX, |
| 295 | FeatureCMOV, FeatureFXSR]>; |
| 296 | def : Proc<"pentium3", [FeatureX87, FeatureSlowUAMem16, FeatureMMX, |
| 297 | FeatureSSE1, FeatureFXSR]>; |
| 298 | def : Proc<"pentium3m", [FeatureX87, FeatureSlowUAMem16, FeatureMMX, |
| 299 | FeatureSSE1, FeatureFXSR, FeatureSlowBTMem]>; |
Mitch Bodart | e60465d | 2016-04-27 22:52:35 +0000 | [diff] [blame] | 300 | |
| 301 | // Enable the PostRAScheduler for SSE2 and SSE3 class cpus. |
| 302 | // The intent is to enable it for pentium4 which is the current default |
| 303 | // processor in a vanilla 32-bit clang compilation when no specific |
| 304 | // architecture is specified. This generally gives a nice performance |
| 305 | // increase on silvermont, with largely neutral behavior on other |
| 306 | // contemporary large core processors. |
| 307 | // pentium-m, pentium4m, prescott and nocona are included as a preventative |
| 308 | // measure to avoid performance surprises, in case clang's default cpu |
| 309 | // changes slightly. |
| 310 | |
| 311 | def : ProcessorModel<"pentium-m", GenericPostRAModel, |
| 312 | [FeatureX87, FeatureSlowUAMem16, FeatureMMX, |
| 313 | FeatureSSE2, FeatureFXSR, FeatureSlowBTMem]>; |
| 314 | |
| 315 | def : ProcessorModel<"pentium4", GenericPostRAModel, |
| 316 | [FeatureX87, FeatureSlowUAMem16, FeatureMMX, |
| 317 | FeatureSSE2, FeatureFXSR]>; |
| 318 | |
| 319 | def : ProcessorModel<"pentium4m", GenericPostRAModel, |
| 320 | [FeatureX87, FeatureSlowUAMem16, FeatureMMX, |
| 321 | FeatureSSE2, FeatureFXSR, FeatureSlowBTMem]>; |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 322 | |
Andrey Turetskiy | 958eb46 | 2016-04-01 10:16:15 +0000 | [diff] [blame] | 323 | // Intel Quark. |
| 324 | def : Proc<"lakemont", []>; |
| 325 | |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 326 | // Intel Core Duo. |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 327 | def : ProcessorModel<"yonah", SandyBridgeModel, |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 328 | [FeatureX87, FeatureSlowUAMem16, FeatureMMX, FeatureSSE3, |
| 329 | FeatureFXSR, FeatureSlowBTMem]>; |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 330 | |
| 331 | // NetBurst. |
Mitch Bodart | e60465d | 2016-04-27 22:52:35 +0000 | [diff] [blame] | 332 | def : ProcessorModel<"prescott", GenericPostRAModel, |
| 333 | [FeatureX87, FeatureSlowUAMem16, FeatureMMX, FeatureSSE3, |
| 334 | FeatureFXSR, FeatureSlowBTMem]>; |
| 335 | def : ProcessorModel<"nocona", GenericPostRAModel, [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 336 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 337 | FeatureSlowUAMem16, |
| 338 | FeatureMMX, |
| 339 | FeatureSSE3, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 340 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 341 | FeatureCMPXCHG16B, |
| 342 | FeatureSlowBTMem |
| 343 | ]>; |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 344 | |
| 345 | // Intel Core 2 Solo/Duo. |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 346 | def : ProcessorModel<"core2", SandyBridgeModel, [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 347 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 348 | FeatureSlowUAMem16, |
| 349 | FeatureMMX, |
| 350 | FeatureSSSE3, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 351 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 352 | FeatureCMPXCHG16B, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 353 | FeatureSlowBTMem, |
| 354 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 355 | ]>; |
| 356 | def : ProcessorModel<"penryn", SandyBridgeModel, [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 357 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 358 | FeatureSlowUAMem16, |
| 359 | FeatureMMX, |
| 360 | FeatureSSE41, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 361 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 362 | FeatureCMPXCHG16B, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 363 | FeatureSlowBTMem, |
| 364 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 365 | ]>; |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 366 | |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 367 | // Atom CPUs. |
| 368 | class BonnellProc<string Name> : ProcessorModel<Name, AtomModel, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 369 | ProcIntelAtom, |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 370 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 371 | FeatureSlowUAMem16, |
| 372 | FeatureMMX, |
| 373 | FeatureSSSE3, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 374 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 375 | FeatureCMPXCHG16B, |
| 376 | FeatureMOVBE, |
| 377 | FeatureSlowBTMem, |
Sanjay Patel | 53d1d8b | 2015-10-12 15:24:01 +0000 | [diff] [blame] | 378 | FeatureLEAForSP, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 379 | FeatureSlowDivide32, |
| 380 | FeatureSlowDivide64, |
| 381 | FeatureCallRegIndirect, |
| 382 | FeatureLEAUsesAG, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 383 | FeaturePadShortFunctions, |
| 384 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 385 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 386 | def : BonnellProc<"bonnell">; |
| 387 | def : BonnellProc<"atom">; // Pin the generic name to the baseline. |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 388 | |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 389 | class SilvermontProc<string Name> : ProcessorModel<Name, SLMModel, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 390 | ProcIntelSLM, |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 391 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 392 | FeatureMMX, |
| 393 | FeatureSSE42, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 394 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 395 | FeatureCMPXCHG16B, |
| 396 | FeatureMOVBE, |
| 397 | FeaturePOPCNT, |
| 398 | FeaturePCLMUL, |
| 399 | FeatureAES, |
| 400 | FeatureSlowDivide64, |
| 401 | FeatureCallRegIndirect, |
| 402 | FeaturePRFCHW, |
| 403 | FeatureSlowLEA, |
| 404 | FeatureSlowIncDec, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 405 | FeatureSlowBTMem, |
Zvi Rackover | 8bc7e4d | 2016-12-06 19:35:20 +0000 | [diff] [blame] | 406 | FeatureSlowPMULLD, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 407 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 408 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 409 | def : SilvermontProc<"silvermont">; |
| 410 | def : SilvermontProc<"slm">; // Legacy alias. |
| 411 | |
Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 412 | // "Arrandale" along with corei3 and corei5 |
Craig Topper | 3611d9b | 2015-03-30 06:31:11 +0000 | [diff] [blame] | 413 | class NehalemProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 414 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 415 | FeatureMMX, |
| 416 | FeatureSSE42, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 417 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 418 | FeatureCMPXCHG16B, |
| 419 | FeatureSlowBTMem, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 420 | FeaturePOPCNT, |
| 421 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 422 | ]>; |
Craig Topper | 3611d9b | 2015-03-30 06:31:11 +0000 | [diff] [blame] | 423 | def : NehalemProc<"nehalem">; |
| 424 | def : NehalemProc<"corei7">; |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 425 | |
Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 426 | // Westmere is a similar machine to nehalem with some additional features. |
| 427 | // Westmere is the corei3/i5/i7 path from nehalem to sandybridge |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 428 | class WestmereProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 429 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 430 | FeatureMMX, |
| 431 | FeatureSSE42, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 432 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 433 | FeatureCMPXCHG16B, |
| 434 | FeatureSlowBTMem, |
| 435 | FeaturePOPCNT, |
| 436 | FeatureAES, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 437 | FeaturePCLMUL, |
| 438 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 439 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 440 | def : WestmereProc<"westmere">; |
| 441 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 442 | class ProcessorFeatures<list<SubtargetFeature> Inherited, |
| 443 | list<SubtargetFeature> NewFeatures> { |
| 444 | list<SubtargetFeature> Value = !listconcat(Inherited, NewFeatures); |
| 445 | } |
| 446 | |
| 447 | class ProcModel<string Name, SchedMachineModel Model, |
| 448 | list<SubtargetFeature> ProcFeatures, |
| 449 | list<SubtargetFeature> OtherFeatures> : |
| 450 | ProcessorModel<Name, Model, !listconcat(ProcFeatures, OtherFeatures)>; |
| 451 | |
Nate Begeman | 8b08f52 | 2010-12-10 00:26:57 +0000 | [diff] [blame] | 452 | // SSE is not listed here since llvm treats AVX as a reimplementation of SSE, |
| 453 | // rather than a superset. |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 454 | def SNBFeatures : ProcessorFeatures<[], [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 455 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 456 | FeatureMMX, |
| 457 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 458 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 459 | FeatureCMPXCHG16B, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 460 | FeaturePOPCNT, |
| 461 | FeatureAES, |
Nikolai Bozhenov | 6bdf92c | 2017-01-12 19:34:15 +0000 | [diff] [blame] | 462 | FeatureSlowDivide64, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 463 | FeaturePCLMUL, |
| 464 | FeatureXSAVE, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 465 | FeatureXSAVEOPT, |
Nikolai Bozhenov | f679530 | 2016-08-04 12:47:28 +0000 | [diff] [blame] | 466 | FeatureLAHFSAHF, |
| 467 | FeatureFastScalarFSQRT |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 468 | ]>; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 469 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 470 | class SandyBridgeProc<string Name> : ProcModel<Name, SandyBridgeModel, |
| 471 | SNBFeatures.Value, [ |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 472 | FeatureSlowBTMem, |
| 473 | FeatureSlowUAMem32 |
| 474 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 475 | def : SandyBridgeProc<"sandybridge">; |
| 476 | def : SandyBridgeProc<"corei7-avx">; // Legacy alias. |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 477 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 478 | def IVBFeatures : ProcessorFeatures<SNBFeatures.Value, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 479 | FeatureRDRAND, |
| 480 | FeatureF16C, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 481 | FeatureFSGSBase |
| 482 | ]>; |
| 483 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 484 | class IvyBridgeProc<string Name> : ProcModel<Name, SandyBridgeModel, |
| 485 | IVBFeatures.Value, [ |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 486 | FeatureSlowBTMem, |
| 487 | FeatureSlowUAMem32 |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 488 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 489 | def : IvyBridgeProc<"ivybridge">; |
| 490 | def : IvyBridgeProc<"core-avx-i">; // Legacy alias. |
Craig Topper | 3657fe4 | 2011-10-14 03:21:46 +0000 | [diff] [blame] | 491 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 492 | def HSWFeatures : ProcessorFeatures<IVBFeatures.Value, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 493 | FeatureAVX2, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 494 | FeatureBMI, |
| 495 | FeatureBMI2, |
| 496 | FeatureFMA, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 497 | FeatureLZCNT, |
| 498 | FeatureMOVBE, |
| 499 | FeatureINVPCID, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 500 | FeatureRTM, |
| 501 | FeatureHLE, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 502 | FeatureSlowIncDec |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 503 | ]>; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 504 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 505 | class HaswellProc<string Name> : ProcModel<Name, HaswellModel, |
| 506 | HSWFeatures.Value, []>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 507 | def : HaswellProc<"haswell">; |
| 508 | def : HaswellProc<"core-avx2">; // Legacy alias. |
| 509 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 510 | def BDWFeatures : ProcessorFeatures<HSWFeatures.Value, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 511 | FeatureADX, |
| 512 | FeatureRDSEED, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 513 | FeatureSMAP |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 514 | ]>; |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 515 | class BroadwellProc<string Name> : ProcModel<Name, HaswellModel, |
| 516 | BDWFeatures.Value, []>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 517 | def : BroadwellProc<"broadwell">; |
| 518 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 519 | def SKLFeatures : ProcessorFeatures<BDWFeatures.Value, [ |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 520 | FeatureMPX, |
| 521 | FeatureXSAVEC, |
| 522 | FeatureXSAVES, |
| 523 | FeatureSGX, |
Nikolai Bozhenov | f679530 | 2016-08-04 12:47:28 +0000 | [diff] [blame] | 524 | FeatureCLFLUSHOPT, |
| 525 | FeatureFastVectorFSQRT |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 526 | ]>; |
| 527 | |
| 528 | // FIXME: define SKL model |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 529 | class SkylakeClientProc<string Name> : ProcModel<Name, HaswellModel, |
| 530 | SKLFeatures.Value, []>; |
Sanjoy Das | aa63dc0 | 2016-02-21 17:12:03 +0000 | [diff] [blame] | 531 | def : SkylakeClientProc<"skylake">; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 532 | |
Elena Demikhovsky | 8cfb43f | 2013-07-24 11:02:47 +0000 | [diff] [blame] | 533 | // FIXME: define KNL model |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 534 | class KnightsLandingProc<string Name> : ProcModel<Name, HaswellModel, |
| 535 | IVBFeatures.Value, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 536 | FeatureAVX512, |
| 537 | FeatureERI, |
| 538 | FeatureCDI, |
| 539 | FeaturePFI, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 540 | FeaturePREFETCHWT1, |
| 541 | FeatureADX, |
| 542 | FeatureRDSEED, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 543 | FeatureMOVBE, |
| 544 | FeatureLZCNT, |
| 545 | FeatureBMI, |
| 546 | FeatureBMI2, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 547 | FeatureFMA |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 548 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 549 | def : KnightsLandingProc<"knl">; |
Elena Demikhovsky | 8cfb43f | 2013-07-24 11:02:47 +0000 | [diff] [blame] | 550 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 551 | def SKXFeatures : ProcessorFeatures<SKLFeatures.Value, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 552 | FeatureAVX512, |
| 553 | FeatureCDI, |
| 554 | FeatureDQI, |
| 555 | FeatureBWI, |
| 556 | FeatureVLX, |
Asaf Badouh | 5acf66f | 2015-12-15 13:35:29 +0000 | [diff] [blame] | 557 | FeaturePKU, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 558 | FeatureCLWB |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 559 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 560 | |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 561 | // FIXME: define SKX model |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 562 | class SkylakeServerProc<string Name> : ProcModel<Name, HaswellModel, |
| 563 | SKXFeatures.Value, []>; |
Sanjoy Das | aa63dc0 | 2016-02-21 17:12:03 +0000 | [diff] [blame] | 564 | def : SkylakeServerProc<"skylake-avx512">; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 565 | def : SkylakeServerProc<"skx">; // Legacy alias. |
| 566 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 567 | def CNLFeatures : ProcessorFeatures<SKXFeatures.Value, [ |
Elena Demikhovsky | 9242ea8 | 2016-01-18 13:00:31 +0000 | [diff] [blame] | 568 | FeatureVBMI, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 569 | FeatureIFMA, |
| 570 | FeatureSHA |
Elena Demikhovsky | 9242ea8 | 2016-01-18 13:00:31 +0000 | [diff] [blame] | 571 | ]>; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 572 | |
Craig Topper | f730a6b | 2016-02-13 21:35:37 +0000 | [diff] [blame] | 573 | class CannonlakeProc<string Name> : ProcModel<Name, HaswellModel, |
| 574 | CNLFeatures.Value, []>; |
Elena Demikhovsky | 9242ea8 | 2016-01-18 13:00:31 +0000 | [diff] [blame] | 575 | def : CannonlakeProc<"cannonlake">; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 576 | |
| 577 | // AMD CPUs. |
Robert Khasanov | bfa0131 | 2014-07-21 14:54:21 +0000 | [diff] [blame] | 578 | |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 579 | def : Proc<"k6", [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>; |
| 580 | def : Proc<"k6-2", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>; |
| 581 | def : Proc<"k6-3", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>; |
| 582 | def : Proc<"athlon", [FeatureX87, FeatureSlowUAMem16, Feature3DNowA, |
Sanjay Patel | 9e916dc | 2015-08-21 20:17:26 +0000 | [diff] [blame] | 583 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 584 | def : Proc<"athlon-tbird", [FeatureX87, FeatureSlowUAMem16, Feature3DNowA, |
Sanjay Patel | 9e916dc | 2015-08-21 20:17:26 +0000 | [diff] [blame] | 585 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 586 | def : Proc<"athlon-4", [FeatureX87, FeatureSlowUAMem16, FeatureSSE1, |
| 587 | Feature3DNowA, FeatureFXSR, FeatureSlowBTMem, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 588 | FeatureSlowSHLD]>; |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 589 | def : Proc<"athlon-xp", [FeatureX87, FeatureSlowUAMem16, FeatureSSE1, |
| 590 | Feature3DNowA, FeatureFXSR, FeatureSlowBTMem, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 591 | FeatureSlowSHLD]>; |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 592 | def : Proc<"athlon-mp", [FeatureX87, FeatureSlowUAMem16, FeatureSSE1, |
| 593 | Feature3DNowA, FeatureFXSR, FeatureSlowBTMem, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 594 | FeatureSlowSHLD]>; |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 595 | def : Proc<"k8", [FeatureX87, FeatureSlowUAMem16, FeatureSSE2, |
| 596 | Feature3DNowA, FeatureFXSR, Feature64Bit, |
| 597 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
| 598 | def : Proc<"opteron", [FeatureX87, FeatureSlowUAMem16, FeatureSSE2, |
| 599 | Feature3DNowA, FeatureFXSR, Feature64Bit, |
| 600 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
| 601 | def : Proc<"athlon64", [FeatureX87, FeatureSlowUAMem16, FeatureSSE2, |
| 602 | Feature3DNowA, FeatureFXSR, Feature64Bit, |
| 603 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
| 604 | def : Proc<"athlon-fx", [FeatureX87, FeatureSlowUAMem16, FeatureSSE2, |
| 605 | Feature3DNowA, FeatureFXSR, Feature64Bit, |
| 606 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
| 607 | def : Proc<"k8-sse3", [FeatureX87, FeatureSlowUAMem16, FeatureSSE3, |
| 608 | Feature3DNowA, FeatureFXSR, FeatureCMPXCHG16B, |
| 609 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
| 610 | def : Proc<"opteron-sse3", [FeatureX87, FeatureSlowUAMem16, FeatureSSE3, |
| 611 | Feature3DNowA, FeatureFXSR, FeatureCMPXCHG16B, |
| 612 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
| 613 | def : Proc<"athlon64-sse3", [FeatureX87, FeatureSlowUAMem16, FeatureSSE3, |
| 614 | Feature3DNowA, FeatureFXSR, FeatureCMPXCHG16B, |
| 615 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
| 616 | def : Proc<"amdfam10", [FeatureX87, FeatureSSE4A, Feature3DNowA, |
| 617 | FeatureFXSR, FeatureCMPXCHG16B, FeatureLZCNT, |
| 618 | FeaturePOPCNT, FeatureSlowBTMem, FeatureSlowSHLD, |
| 619 | FeatureLAHFSAHF]>; |
| 620 | def : Proc<"barcelona", [FeatureX87, FeatureSSE4A, Feature3DNowA, |
| 621 | FeatureFXSR, FeatureCMPXCHG16B, FeatureLZCNT, |
| 622 | FeaturePOPCNT, FeatureSlowBTMem, FeatureSlowSHLD, |
| 623 | FeatureLAHFSAHF]>; |
Sanjay Patel | 9e916dc | 2015-08-21 20:17:26 +0000 | [diff] [blame] | 624 | |
Benjamin Kramer | 077ae1d | 2012-01-10 11:50:02 +0000 | [diff] [blame] | 625 | // Bobcat |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 626 | def : Proc<"btver1", [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 627 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 628 | FeatureMMX, |
| 629 | FeatureSSSE3, |
| 630 | FeatureSSE4A, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 631 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 632 | FeatureCMPXCHG16B, |
| 633 | FeaturePRFCHW, |
| 634 | FeatureLZCNT, |
| 635 | FeaturePOPCNT, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 636 | FeatureSlowSHLD, |
| 637 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 638 | ]>; |
Sanjay Patel | 1191adf | 2014-09-09 20:07:07 +0000 | [diff] [blame] | 639 | |
Benjamin Kramer | b44c427 | 2013-05-03 10:20:08 +0000 | [diff] [blame] | 640 | // Jaguar |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 641 | def : ProcessorModel<"btver2", BtVer2Model, [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 642 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 643 | FeatureMMX, |
| 644 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 645 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 646 | FeatureSSE4A, |
| 647 | FeatureCMPXCHG16B, |
| 648 | FeaturePRFCHW, |
| 649 | FeatureAES, |
| 650 | FeaturePCLMUL, |
| 651 | FeatureBMI, |
| 652 | FeatureF16C, |
| 653 | FeatureMOVBE, |
| 654 | FeatureLZCNT, |
Pierre Gousseau | b6d652a | 2016-10-14 16:41:38 +0000 | [diff] [blame] | 655 | FeatureFastLZCNT, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 656 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 657 | FeatureXSAVE, |
| 658 | FeatureXSAVEOPT, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 659 | FeatureSlowSHLD, |
Yunzhong Gao | 0de36ec | 2016-02-12 23:37:57 +0000 | [diff] [blame] | 660 | FeatureLAHFSAHF, |
| 661 | FeatureFastPartialYMMWrite |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 662 | ]>; |
Sanjay Patel | e57f3c0 | 2014-11-28 18:40:18 +0000 | [diff] [blame] | 663 | |
Benjamin Kramer | 077ae1d | 2012-01-10 11:50:02 +0000 | [diff] [blame] | 664 | // Bulldozer |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 665 | def : Proc<"bdver1", [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 666 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 667 | FeatureXOP, |
| 668 | FeatureFMA4, |
| 669 | FeatureCMPXCHG16B, |
| 670 | FeatureAES, |
| 671 | FeaturePRFCHW, |
| 672 | FeaturePCLMUL, |
| 673 | FeatureMMX, |
| 674 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 675 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 676 | FeatureSSE4A, |
| 677 | FeatureLZCNT, |
| 678 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 679 | FeatureXSAVE, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 680 | FeatureSlowSHLD, |
| 681 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 682 | ]>; |
Benjamin Kramer | b44c427 | 2013-05-03 10:20:08 +0000 | [diff] [blame] | 683 | // Piledriver |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 684 | def : Proc<"bdver2", [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 685 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 686 | FeatureXOP, |
| 687 | FeatureFMA4, |
| 688 | FeatureCMPXCHG16B, |
| 689 | FeatureAES, |
| 690 | FeaturePRFCHW, |
| 691 | FeaturePCLMUL, |
| 692 | FeatureMMX, |
| 693 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 694 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 695 | FeatureSSE4A, |
| 696 | FeatureF16C, |
| 697 | FeatureLZCNT, |
| 698 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 699 | FeatureXSAVE, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 700 | FeatureBMI, |
| 701 | FeatureTBM, |
| 702 | FeatureFMA, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 703 | FeatureSlowSHLD, |
| 704 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 705 | ]>; |
Benjamin Kramer | d114def | 2013-11-04 10:29:20 +0000 | [diff] [blame] | 706 | |
| 707 | // Steamroller |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 708 | def : Proc<"bdver3", [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 709 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 710 | FeatureXOP, |
| 711 | FeatureFMA4, |
| 712 | FeatureCMPXCHG16B, |
| 713 | FeatureAES, |
| 714 | FeaturePRFCHW, |
| 715 | FeaturePCLMUL, |
| 716 | FeatureMMX, |
| 717 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 718 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 719 | FeatureSSE4A, |
| 720 | FeatureF16C, |
| 721 | FeatureLZCNT, |
| 722 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 723 | FeatureXSAVE, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 724 | FeatureBMI, |
| 725 | FeatureTBM, |
| 726 | FeatureFMA, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 727 | FeatureXSAVEOPT, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 728 | FeatureSlowSHLD, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 729 | FeatureFSGSBase, |
| 730 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 731 | ]>; |
Benjamin Kramer | d114def | 2013-11-04 10:29:20 +0000 | [diff] [blame] | 732 | |
Benjamin Kramer | 6004573 | 2014-05-02 15:47:07 +0000 | [diff] [blame] | 733 | // Excavator |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 734 | def : Proc<"bdver4", [ |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 735 | FeatureX87, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 736 | FeatureMMX, |
| 737 | FeatureAVX2, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 738 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 739 | FeatureXOP, |
| 740 | FeatureFMA4, |
| 741 | FeatureCMPXCHG16B, |
| 742 | FeatureAES, |
| 743 | FeaturePRFCHW, |
| 744 | FeaturePCLMUL, |
| 745 | FeatureF16C, |
| 746 | FeatureLZCNT, |
| 747 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 748 | FeatureXSAVE, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 749 | FeatureBMI, |
| 750 | FeatureBMI2, |
| 751 | FeatureTBM, |
| 752 | FeatureFMA, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 753 | FeatureXSAVEOPT, |
Simon Pilgrim | 381a0ad | 2016-07-24 16:00:53 +0000 | [diff] [blame] | 754 | FeatureSlowSHLD, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 755 | FeatureFSGSBase, |
Ashutosh Nema | 348af9c | 2016-05-18 11:59:12 +0000 | [diff] [blame] | 756 | FeatureLAHFSAHF, |
| 757 | FeatureMWAITX |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 758 | ]>; |
Benjamin Kramer | 6004573 | 2014-05-02 15:47:07 +0000 | [diff] [blame] | 759 | |
Craig Topper | d55b831 | 2017-01-10 06:01:16 +0000 | [diff] [blame] | 760 | // TODO: The scheduler model falls to BTVER2 model. |
| 761 | // The znver1 model has to be put in place. |
| 762 | // Zen |
| 763 | def: ProcessorModel<"znver1", BtVer2Model, [ |
| 764 | FeatureADX, |
| 765 | FeatureAES, |
| 766 | FeatureAVX2, |
| 767 | FeatureBMI, |
| 768 | FeatureBMI2, |
| 769 | FeatureCLFLUSHOPT, |
Craig Topper | 50f3d14 | 2017-02-09 04:27:34 +0000 | [diff] [blame] | 770 | FeatureCLZERO, |
Craig Topper | d55b831 | 2017-01-10 06:01:16 +0000 | [diff] [blame] | 771 | FeatureCMPXCHG16B, |
| 772 | FeatureF16C, |
| 773 | FeatureFMA, |
| 774 | FeatureFSGSBase, |
| 775 | FeatureFXSR, |
| 776 | FeatureFastLZCNT, |
| 777 | FeatureLAHFSAHF, |
| 778 | FeatureLZCNT, |
| 779 | FeatureMMX, |
| 780 | FeatureMOVBE, |
| 781 | FeatureMWAITX, |
| 782 | FeaturePCLMUL, |
| 783 | FeaturePOPCNT, |
| 784 | FeaturePRFCHW, |
| 785 | FeatureRDRAND, |
| 786 | FeatureRDSEED, |
| 787 | FeatureSHA, |
| 788 | FeatureSMAP, |
| 789 | FeatureSSE4A, |
| 790 | FeatureSlowSHLD, |
| 791 | FeatureX87, |
| 792 | FeatureXSAVE, |
| 793 | FeatureXSAVEC, |
| 794 | FeatureXSAVEOPT, |
| 795 | FeatureXSAVES]>; |
| 796 | |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 797 | def : Proc<"geode", [FeatureX87, FeatureSlowUAMem16, Feature3DNowA]>; |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 798 | |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 799 | def : Proc<"winchip-c6", [FeatureX87, FeatureSlowUAMem16, FeatureMMX]>; |
| 800 | def : Proc<"winchip2", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>; |
| 801 | def : Proc<"c3", [FeatureX87, FeatureSlowUAMem16, Feature3DNow]>; |
| 802 | def : Proc<"c3-2", [FeatureX87, FeatureSlowUAMem16, FeatureMMX, |
| 803 | FeatureSSE1, FeatureFXSR]>; |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 804 | |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 805 | // We also provide a generic 64-bit specific x86 processor model which tries to |
| 806 | // be good for modern chips without enabling instruction set encodings past the |
| 807 | // basic SSE2 and 64-bit ones. It disables slow things from any mainstream and |
| 808 | // modern 64-bit x86 chip, and enables features that are generally beneficial. |
Michael Liao | 5bf9578 | 2014-12-04 05:20:33 +0000 | [diff] [blame] | 809 | // |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 810 | // We currently use the Sandy Bridge model as the default scheduling model as |
| 811 | // we use it across Nehalem, Westmere, Sandy Bridge, and Ivy Bridge which |
| 812 | // covers a huge swath of x86 processors. If there are specific scheduling |
| 813 | // knobs which need to be tuned differently for AMD chips, we might consider |
| 814 | // forming a common base for them. |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 815 | def : ProcessorModel<"x86-64", SandyBridgeModel, |
Andrey Turetskiy | 6a3d561 | 2016-03-23 11:13:54 +0000 | [diff] [blame] | 816 | [FeatureX87, FeatureMMX, FeatureSSE2, FeatureFXSR, |
| 817 | Feature64Bit, FeatureSlowBTMem ]>; |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 818 | |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 819 | //===----------------------------------------------------------------------===// |
Chris Lattner | 5da8e80 | 2003-08-03 15:47:49 +0000 | [diff] [blame] | 820 | // Register File Description |
| 821 | //===----------------------------------------------------------------------===// |
| 822 | |
| 823 | include "X86RegisterInfo.td" |
| 824 | |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 825 | //===----------------------------------------------------------------------===// |
| 826 | // Instruction Descriptions |
| 827 | //===----------------------------------------------------------------------===// |
| 828 | |
Chris Lattner | 59a4a91 | 2003-08-03 21:54:21 +0000 | [diff] [blame] | 829 | include "X86InstrInfo.td" |
| 830 | |
Jakob Stoklund Olesen | b93331f | 2010-04-05 03:10:20 +0000 | [diff] [blame] | 831 | def X86InstrInfo : InstrInfo; |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 832 | |
Chris Lattner | 5d00a0b | 2007-02-26 18:17:14 +0000 | [diff] [blame] | 833 | //===----------------------------------------------------------------------===// |
| 834 | // Calling Conventions |
| 835 | //===----------------------------------------------------------------------===// |
| 836 | |
| 837 | include "X86CallingConv.td" |
| 838 | |
| 839 | |
| 840 | //===----------------------------------------------------------------------===// |
Jim Grosbach | 4cf25f5 | 2010-10-30 13:48:28 +0000 | [diff] [blame] | 841 | // Assembly Parser |
Chris Lattner | 5d00a0b | 2007-02-26 18:17:14 +0000 | [diff] [blame] | 842 | //===----------------------------------------------------------------------===// |
| 843 | |
Devang Patel | 85d684a | 2012-01-09 19:13:28 +0000 | [diff] [blame] | 844 | def ATTAsmParserVariant : AsmParserVariant { |
Daniel Dunbar | 0033199 | 2009-07-29 00:02:19 +0000 | [diff] [blame] | 845 | int Variant = 0; |
Daniel Dunbar | e431871 | 2009-08-11 20:59:47 +0000 | [diff] [blame] | 846 | |
Chad Rosier | 9f7a221 | 2013-04-18 22:35:36 +0000 | [diff] [blame] | 847 | // Variant name. |
| 848 | string Name = "att"; |
| 849 | |
Daniel Dunbar | e431871 | 2009-08-11 20:59:47 +0000 | [diff] [blame] | 850 | // Discard comments in assembly strings. |
| 851 | string CommentDelimiter = "#"; |
| 852 | |
| 853 | // Recognize hard coded registers. |
| 854 | string RegisterPrefix = "%"; |
Daniel Dunbar | 0033199 | 2009-07-29 00:02:19 +0000 | [diff] [blame] | 855 | } |
| 856 | |
Devang Patel | 67bf992a | 2012-01-10 17:51:54 +0000 | [diff] [blame] | 857 | def IntelAsmParserVariant : AsmParserVariant { |
| 858 | int Variant = 1; |
| 859 | |
Chad Rosier | 9f7a221 | 2013-04-18 22:35:36 +0000 | [diff] [blame] | 860 | // Variant name. |
| 861 | string Name = "intel"; |
| 862 | |
Devang Patel | 67bf992a | 2012-01-10 17:51:54 +0000 | [diff] [blame] | 863 | // Discard comments in assembly strings. |
| 864 | string CommentDelimiter = ";"; |
| 865 | |
| 866 | // Recognize hard coded registers. |
| 867 | string RegisterPrefix = ""; |
| 868 | } |
| 869 | |
Jim Grosbach | 4cf25f5 | 2010-10-30 13:48:28 +0000 | [diff] [blame] | 870 | //===----------------------------------------------------------------------===// |
| 871 | // Assembly Printers |
| 872 | //===----------------------------------------------------------------------===// |
| 873 | |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 874 | // The X86 target supports two different syntaxes for emitting machine code. |
| 875 | // This is controlled by the -x86-asm-syntax={att|intel} |
| 876 | def ATTAsmWriter : AsmWriter { |
Chris Lattner | 1cbd3de | 2009-09-13 19:30:11 +0000 | [diff] [blame] | 877 | string AsmWriterClassName = "ATTInstPrinter"; |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 878 | int Variant = 0; |
| 879 | } |
| 880 | def IntelAsmWriter : AsmWriter { |
Chris Lattner | 13306a1 | 2009-09-20 07:47:59 +0000 | [diff] [blame] | 881 | string AsmWriterClassName = "IntelInstPrinter"; |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 882 | int Variant = 1; |
| 883 | } |
| 884 | |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 885 | def X86 : Target { |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 886 | // Information about the instructions... |
Chris Lattner | 2551080 | 2003-08-04 04:59:56 +0000 | [diff] [blame] | 887 | let InstructionSet = X86InstrInfo; |
Devang Patel | 67bf992a | 2012-01-10 17:51:54 +0000 | [diff] [blame] | 888 | let AssemblyParserVariants = [ATTAsmParserVariant, IntelAsmParserVariant]; |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 889 | let AssemblyWriters = [ATTAsmWriter, IntelAsmWriter]; |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 890 | } |