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 | |
| 34 | def FeatureCMOV : SubtargetFeature<"cmov","HasCMov", "true", |
| 35 | "Enable conditional move instructions">; |
| 36 | |
Benjamin Kramer | 2f48923 | 2010-12-04 20:32:23 +0000 | [diff] [blame] | 37 | def FeaturePOPCNT : SubtargetFeature<"popcnt", "HasPOPCNT", "true", |
| 38 | "Support POPCNT instruction">; |
| 39 | |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 40 | def FeatureFXSR : SubtargetFeature<"fxsr", "HasFXSR", "true", |
| 41 | "Support fxsave/fxrestore instructions">; |
| 42 | |
Amjad Aboud | 1db6d7a | 2015-10-12 11:47:46 +0000 | [diff] [blame] | 43 | def FeatureXSAVE : SubtargetFeature<"xsave", "HasXSAVE", "true", |
| 44 | "Support xsave instructions">; |
| 45 | |
| 46 | def FeatureXSAVEOPT: SubtargetFeature<"xsaveopt", "HasXSAVEOPT", "true", |
| 47 | "Support xsaveopt instructions">; |
| 48 | |
| 49 | def FeatureXSAVEC : SubtargetFeature<"xsavec", "HasXSAVEC", "true", |
| 50 | "Support xsavec instructions">; |
| 51 | |
| 52 | def FeatureXSAVES : SubtargetFeature<"xsaves", "HasXSAVES", "true", |
| 53 | "Support xsaves instructions">; |
| 54 | |
Bill Wendling | e618226 | 2007-05-04 20:38:40 +0000 | [diff] [blame] | 55 | def FeatureSSE1 : SubtargetFeature<"sse", "X86SSELevel", "SSE1", |
| 56 | "Enable SSE instructions", |
Chris Lattner | cc8c581 | 2009-09-02 05:53:04 +0000 | [diff] [blame] | 57 | // SSE codegen depends on cmovs, and all |
Michael J. Spencer | b88784c | 2011-04-14 14:33:36 +0000 | [diff] [blame] | 58 | // SSE1+ processors support them. |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 59 | [FeatureCMOV]>; |
Bill Wendling | e618226 | 2007-05-04 20:38:40 +0000 | [diff] [blame] | 60 | def FeatureSSE2 : SubtargetFeature<"sse2", "X86SSELevel", "SSE2", |
| 61 | "Enable SSE2 instructions", |
| 62 | [FeatureSSE1]>; |
| 63 | def FeatureSSE3 : SubtargetFeature<"sse3", "X86SSELevel", "SSE3", |
| 64 | "Enable SSE3 instructions", |
| 65 | [FeatureSSE2]>; |
| 66 | def FeatureSSSE3 : SubtargetFeature<"ssse3", "X86SSELevel", "SSSE3", |
| 67 | "Enable SSSE3 instructions", |
| 68 | [FeatureSSE3]>; |
Rafael Espindola | 94a2c56 | 2013-08-23 20:21:34 +0000 | [diff] [blame] | 69 | def FeatureSSE41 : SubtargetFeature<"sse4.1", "X86SSELevel", "SSE41", |
Nate Begeman | e14fdfa | 2008-02-03 07:18:54 +0000 | [diff] [blame] | 70 | "Enable SSE 4.1 instructions", |
| 71 | [FeatureSSSE3]>; |
Rafael Espindola | 94a2c56 | 2013-08-23 20:21:34 +0000 | [diff] [blame] | 72 | def FeatureSSE42 : SubtargetFeature<"sse4.2", "X86SSELevel", "SSE42", |
Nate Begeman | e14fdfa | 2008-02-03 07:18:54 +0000 | [diff] [blame] | 73 | "Enable SSE 4.2 instructions", |
Craig Topper | 7bd3305 | 2011-12-29 15:51:45 +0000 | [diff] [blame] | 74 | [FeatureSSE41]>; |
Eric Christopher | 57a6e13 | 2015-11-14 03:04:00 +0000 | [diff] [blame] | 75 | // The MMX subtarget feature is separate from the rest of the SSE features |
| 76 | // because it's important (for odd compatibility reasons) to be able to |
| 77 | // turn it off explicitly while allowing SSE+ to be on. |
| 78 | def FeatureMMX : SubtargetFeature<"mmx","X863DNowLevel", "MMX", |
| 79 | "Enable MMX instructions">; |
Bill Wendling | e618226 | 2007-05-04 20:38:40 +0000 | [diff] [blame] | 80 | def Feature3DNow : SubtargetFeature<"3dnow", "X863DNowLevel", "ThreeDNow", |
Michael J. Spencer | 30088ba | 2011-04-15 00:32:41 +0000 | [diff] [blame] | 81 | "Enable 3DNow! instructions", |
| 82 | [FeatureMMX]>; |
Bill Wendling | e618226 | 2007-05-04 20:38:40 +0000 | [diff] [blame] | 83 | def Feature3DNowA : SubtargetFeature<"3dnowa", "X863DNowLevel", "ThreeDNowA", |
Bill Wendling | f985c49 | 2007-05-06 07:56:19 +0000 | [diff] [blame] | 84 | "Enable 3DNow! Athlon instructions", |
| 85 | [Feature3DNow]>; |
Dan Gohman | 7403751 | 2009-02-03 00:04:43 +0000 | [diff] [blame] | 86 | // All x86-64 hardware has SSE2, but we don't mark SSE2 as an implied |
| 87 | // feature, because SSE2 can be disabled (e.g. for compiling OS kernels) |
| 88 | // without disabling 64-bit mode. |
Bill Wendling | f985c49 | 2007-05-06 07:56:19 +0000 | [diff] [blame] | 89 | def Feature64Bit : SubtargetFeature<"64bit", "HasX86_64", "true", |
Chris Lattner | 77f7dba | 2010-03-14 22:24:34 +0000 | [diff] [blame] | 90 | "Support 64-bit instructions", |
| 91 | [FeatureCMOV]>; |
Nick Lewycky | 3be42b8 | 2013-10-05 20:11:44 +0000 | [diff] [blame] | 92 | def FeatureCMPXCHG16B : SubtargetFeature<"cx16", "HasCmpxchg16b", "true", |
Eli Friedman | 5e57042 | 2011-08-26 21:21:21 +0000 | [diff] [blame] | 93 | "64-bit with cmpxchg16b", |
| 94 | [Feature64Bit]>; |
Evan Cheng | 4c91aa3 | 2009-01-02 05:35:45 +0000 | [diff] [blame] | 95 | def FeatureSlowBTMem : SubtargetFeature<"slow-bt-mem", "IsBTMemSlow", "true", |
| 96 | "Bit testing of memory is slow">; |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 97 | def FeatureSlowSHLD : SubtargetFeature<"slow-shld", "IsSHLDSlow", "true", |
| 98 | "SHLD instruction is slow">; |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 99 | // FIXME: This should not apply to CPUs that do not have SSE. |
| 100 | def FeatureSlowUAMem16 : SubtargetFeature<"slow-unaligned-mem-16", |
| 101 | "IsUAMem16Slow", "true", |
| 102 | "Slow unaligned 16-byte memory access">; |
Sanjay Patel | 501890e | 2014-11-21 17:40:04 +0000 | [diff] [blame] | 103 | def FeatureSlowUAMem32 : SubtargetFeature<"slow-unaligned-mem-32", |
Sanjay Patel | 9e916dc | 2015-08-21 20:17:26 +0000 | [diff] [blame] | 104 | "IsUAMem32Slow", "true", |
| 105 | "Slow unaligned 32-byte memory access">; |
Stefanus Du Toit | 96180b5 | 2009-05-26 21:04:35 +0000 | [diff] [blame] | 106 | def FeatureSSE4A : SubtargetFeature<"sse4a", "HasSSE4A", "true", |
Craig Topper | a5d1fc2 | 2011-12-30 07:16:00 +0000 | [diff] [blame] | 107 | "Support SSE 4a instructions", |
| 108 | [FeatureSSE3]>; |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 109 | |
Craig Topper | f287a45 | 2012-01-09 09:02:13 +0000 | [diff] [blame] | 110 | def FeatureAVX : SubtargetFeature<"avx", "X86SSELevel", "AVX", |
| 111 | "Enable AVX instructions", |
| 112 | [FeatureSSE42]>; |
| 113 | def FeatureAVX2 : SubtargetFeature<"avx2", "X86SSELevel", "AVX2", |
Craig Topper | 228d913 | 2011-10-30 19:57:21 +0000 | [diff] [blame] | 114 | "Enable AVX2 instructions", |
| 115 | [FeatureAVX]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 116 | def FeatureAVX512 : SubtargetFeature<"avx512f", "X86SSELevel", "AVX512F", |
Elena Demikhovsky | 8cfb43f | 2013-07-24 11:02:47 +0000 | [diff] [blame] | 117 | "Enable AVX-512 instructions", |
| 118 | [FeatureAVX2]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 119 | def FeatureERI : SubtargetFeature<"avx512er", "HasERI", "true", |
Elena Demikhovsky | 003e7d7 | 2013-07-28 08:28:38 +0000 | [diff] [blame] | 120 | "Enable AVX-512 Exponential and Reciprocal Instructions", |
| 121 | [FeatureAVX512]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 122 | def FeatureCDI : SubtargetFeature<"avx512cd", "HasCDI", "true", |
Elena Demikhovsky | 003e7d7 | 2013-07-28 08:28:38 +0000 | [diff] [blame] | 123 | "Enable AVX-512 Conflict Detection Instructions", |
| 124 | [FeatureAVX512]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 125 | def FeaturePFI : SubtargetFeature<"avx512pf", "HasPFI", "true", |
Elena Demikhovsky | 003e7d7 | 2013-07-28 08:28:38 +0000 | [diff] [blame] | 126 | "Enable AVX-512 PreFetch Instructions", |
| 127 | [FeatureAVX512]>; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 128 | def FeaturePREFETCHWT1 : SubtargetFeature<"prefetchwt1", "HasPFPREFETCHWT1", |
| 129 | "true", |
| 130 | "Prefetch with Intent to Write and T1 Hint">; |
Robert Khasanov | bfa0131 | 2014-07-21 14:54:21 +0000 | [diff] [blame] | 131 | def FeatureDQI : SubtargetFeature<"avx512dq", "HasDQI", "true", |
| 132 | "Enable AVX-512 Doubleword and Quadword Instructions", |
| 133 | [FeatureAVX512]>; |
| 134 | def FeatureBWI : SubtargetFeature<"avx512bw", "HasBWI", "true", |
| 135 | "Enable AVX-512 Byte and Word Instructions", |
| 136 | [FeatureAVX512]>; |
| 137 | def FeatureVLX : SubtargetFeature<"avx512vl", "HasVLX", "true", |
| 138 | "Enable AVX-512 Vector Length eXtensions", |
| 139 | [FeatureAVX512]>; |
Michael Zuckerman | 97b6a692 | 2016-01-17 13:42:12 +0000 | [diff] [blame] | 140 | def FeatureVBMI : SubtargetFeature<"avx512vbmi", "HasVBMI", "true", |
| 141 | "Enable AVX-512 Vector Bit Manipulation Instructions", |
| 142 | [FeatureAVX512]>; |
Craig Topper | 3bb3f73 | 2016-02-08 01:23:15 +0000 | [diff] [blame] | 143 | def FeatureIFMA : SubtargetFeature<"avx512ifma", "HasIFMA", "true", |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 144 | "Enable AVX-512 Integer Fused Multiple-Add", |
| 145 | [FeatureAVX512]>; |
Asaf Badouh | 5acf66f | 2015-12-15 13:35:29 +0000 | [diff] [blame] | 146 | def FeaturePKU : SubtargetFeature<"pku", "HasPKU", "true", |
| 147 | "Enable protection keys">; |
Benjamin Kramer | a0396e4 | 2012-05-31 14:34:17 +0000 | [diff] [blame] | 148 | def FeaturePCLMUL : SubtargetFeature<"pclmul", "HasPCLMUL", "true", |
| 149 | "Enable packed carry-less multiplication instructions", |
Craig Topper | 29dd148 | 2012-05-01 05:28:32 +0000 | [diff] [blame] | 150 | [FeatureSSE2]>; |
Craig Topper | 79dbb0c | 2012-06-03 18:58:46 +0000 | [diff] [blame] | 151 | def FeatureFMA : SubtargetFeature<"fma", "HasFMA", "true", |
Craig Topper | e1bd051 | 2011-12-29 19:46:19 +0000 | [diff] [blame] | 152 | "Enable three-operand fused multiple-add", |
| 153 | [FeatureAVX]>; |
David Greene | 8f6f72c | 2009-06-26 22:46:54 +0000 | [diff] [blame] | 154 | def FeatureFMA4 : SubtargetFeature<"fma4", "HasFMA4", "true", |
Craig Topper | a5d1fc2 | 2011-12-30 07:16:00 +0000 | [diff] [blame] | 155 | "Enable four-operand fused multiple-add", |
Craig Topper | bae0e9e | 2012-05-01 06:54:48 +0000 | [diff] [blame] | 156 | [FeatureAVX, FeatureSSE4A]>; |
Craig Topper | a5d1fc2 | 2011-12-30 07:16:00 +0000 | [diff] [blame] | 157 | def FeatureXOP : SubtargetFeature<"xop", "HasXOP", "true", |
Craig Topper | 43518cc | 2012-05-01 05:41:41 +0000 | [diff] [blame] | 158 | "Enable XOP instructions", |
Anitha Boyapati | af3e983 | 2012-08-16 04:04:02 +0000 | [diff] [blame] | 159 | [FeatureFMA4]>; |
Sanjay Patel | ffd039b | 2015-02-03 17:13:04 +0000 | [diff] [blame] | 160 | def FeatureSSEUnalignedMem : SubtargetFeature<"sse-unaligned-mem", |
| 161 | "HasSSEUnalignedMem", "true", |
| 162 | "Allow unaligned memory operands with SSE instructions">; |
Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 163 | def FeatureAES : SubtargetFeature<"aes", "HasAES", "true", |
Craig Topper | 29dd148 | 2012-05-01 05:28:32 +0000 | [diff] [blame] | 164 | "Enable AES instructions", |
| 165 | [FeatureSSE2]>; |
Yunzhong Gao | dd36e93 | 2013-09-24 18:21:52 +0000 | [diff] [blame] | 166 | def FeatureTBM : SubtargetFeature<"tbm", "HasTBM", "true", |
| 167 | "Enable TBM instructions">; |
Craig Topper | 786bdb9 | 2011-10-03 17:28:23 +0000 | [diff] [blame] | 168 | def FeatureMOVBE : SubtargetFeature<"movbe", "HasMOVBE", "true", |
| 169 | "Support MOVBE instruction">; |
Rafael Espindola | 94a2c56 | 2013-08-23 20:21:34 +0000 | [diff] [blame] | 170 | def FeatureRDRAND : SubtargetFeature<"rdrnd", "HasRDRAND", "true", |
Craig Topper | 786bdb9 | 2011-10-03 17:28:23 +0000 | [diff] [blame] | 171 | "Support RDRAND instruction">; |
Craig Topper | fe9179f | 2011-10-09 07:31:39 +0000 | [diff] [blame] | 172 | def FeatureF16C : SubtargetFeature<"f16c", "HasF16C", "true", |
Craig Topper | a6d204e | 2013-09-16 04:29:58 +0000 | [diff] [blame] | 173 | "Support 16-bit floating point conversion instructions", |
| 174 | [FeatureAVX]>; |
Craig Topper | 228d913 | 2011-10-30 19:57:21 +0000 | [diff] [blame] | 175 | def FeatureFSGSBase : SubtargetFeature<"fsgsbase", "HasFSGSBase", "true", |
| 176 | "Support FS/GS Base instructions">; |
Craig Topper | 271064e | 2011-10-11 06:44:02 +0000 | [diff] [blame] | 177 | def FeatureLZCNT : SubtargetFeature<"lzcnt", "HasLZCNT", "true", |
| 178 | "Support LZCNT instruction">; |
Craig Topper | 3657fe4 | 2011-10-14 03:21:46 +0000 | [diff] [blame] | 179 | def FeatureBMI : SubtargetFeature<"bmi", "HasBMI", "true", |
| 180 | "Support BMI instructions">; |
Craig Topper | aea148c | 2011-10-16 07:55:05 +0000 | [diff] [blame] | 181 | def FeatureBMI2 : SubtargetFeature<"bmi2", "HasBMI2", "true", |
| 182 | "Support BMI2 instructions">; |
Michael Liao | 73cffdd | 2012-11-08 07:28:54 +0000 | [diff] [blame] | 183 | def FeatureRTM : SubtargetFeature<"rtm", "HasRTM", "true", |
| 184 | "Support RTM instructions">; |
Michael Liao | e344ec9 | 2013-03-26 22:46:02 +0000 | [diff] [blame] | 185 | def FeatureHLE : SubtargetFeature<"hle", "HasHLE", "true", |
| 186 | "Support HLE">; |
Kay Tiong Khoo | f809c64 | 2013-02-14 19:08:21 +0000 | [diff] [blame] | 187 | def FeatureADX : SubtargetFeature<"adx", "HasADX", "true", |
| 188 | "Support ADX instructions">; |
Ben Langmuir | 1650175 | 2013-09-12 15:51:31 +0000 | [diff] [blame] | 189 | def FeatureSHA : SubtargetFeature<"sha", "HasSHA", "true", |
| 190 | "Enable SHA instructions", |
| 191 | [FeatureSSE2]>; |
Michael Liao | 5173ee0 | 2013-03-26 17:47:11 +0000 | [diff] [blame] | 192 | def FeaturePRFCHW : SubtargetFeature<"prfchw", "HasPRFCHW", "true", |
| 193 | "Support PRFCHW instructions">; |
Michael Liao | a486a11 | 2013-03-28 23:41:26 +0000 | [diff] [blame] | 194 | def FeatureRDSEED : SubtargetFeature<"rdseed", "HasRDSEED", "true", |
| 195 | "Support RDSEED instruction">; |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 196 | def FeatureLAHFSAHF : SubtargetFeature<"sahf", "HasLAHFSAHF", "true", |
| 197 | "Support LAHF and SAHF instructions">; |
Elena Demikhovsky | f7e641c | 2015-06-03 10:30:57 +0000 | [diff] [blame] | 198 | def FeatureMPX : SubtargetFeature<"mpx", "HasMPX", "true", |
| 199 | "Support MPX instructions">; |
Sanjay Patel | 53d1d8b | 2015-10-12 15:24:01 +0000 | [diff] [blame] | 200 | def FeatureLEAForSP : SubtargetFeature<"lea-sp", "UseLeaForSP", "true", |
Evan Cheng | 1b81fdd | 2012-02-07 22:50:41 +0000 | [diff] [blame] | 201 | "Use LEA for adjusting the stack pointer">; |
Alexey Volkov | fd1731d | 2014-11-21 11:19:34 +0000 | [diff] [blame] | 202 | def FeatureSlowDivide32 : SubtargetFeature<"idivl-to-divb", |
| 203 | "HasSlowDivide32", "true", |
| 204 | "Use 8-bit divide for positive values less than 256">; |
| 205 | def FeatureSlowDivide64 : SubtargetFeature<"idivq-to-divw", |
| 206 | "HasSlowDivide64", "true", |
| 207 | "Use 16-bit divide for positive values less than 65536">; |
Preston Gurd | a01daac | 2013-01-08 18:27:24 +0000 | [diff] [blame] | 208 | def FeaturePadShortFunctions : SubtargetFeature<"pad-short-functions", |
| 209 | "PadShortFunctions", "true", |
| 210 | "Pad short functions">; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 211 | def FeatureINVPCID : SubtargetFeature<"invpcid", "HasInvPCId", "true", |
| 212 | "Invalidate Process-Context Identifier">; |
| 213 | def FeatureVMFUNC : SubtargetFeature<"vmfunc", "HasVMFUNC", "true", |
| 214 | "VM Functions">; |
| 215 | def FeatureSMAP : SubtargetFeature<"smap", "HasSMAP", "true", |
| 216 | "Supervisor Mode Access Protection">; |
| 217 | def FeatureSGX : SubtargetFeature<"sgx", "HasSGX", "true", |
| 218 | "Enable Software Guard Extensions">; |
| 219 | def FeatureCLFLUSHOPT : SubtargetFeature<"clflushopt", "HasCLFLUSHOPT", "true", |
| 220 | "Flush A Cache Line Optimized">; |
| 221 | def FeaturePCOMMIT : SubtargetFeature<"pcommit", "HasPCOMMIT", "true", |
| 222 | "Enable Persistent Commit">; |
| 223 | def FeatureCLWB : SubtargetFeature<"clwb", "HasCLWB", "true", |
| 224 | "Cache Line Write Back">; |
Michael Kuperstein | 454d145 | 2015-07-23 12:23:45 +0000 | [diff] [blame] | 225 | // TODO: This feature ought to be renamed. |
Sean Silva | e1c6b54 | 2015-07-27 00:46:59 +0000 | [diff] [blame] | 226 | // What it really refers to are CPUs for which certain instructions |
| 227 | // (which ones besides the example below?) are microcoded. |
Michael Kuperstein | 454d145 | 2015-07-23 12:23:45 +0000 | [diff] [blame] | 228 | // The best examples of this are the memory forms of CALL and PUSH |
| 229 | // 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] | 230 | def FeatureCallRegIndirect : SubtargetFeature<"call-reg-indirect", |
| 231 | "CallRegIndirect", "true", |
| 232 | "Call register indirect">; |
Preston Gurd | 8b7ab4b | 2013-04-25 20:29:37 +0000 | [diff] [blame] | 233 | def FeatureLEAUsesAG : SubtargetFeature<"lea-uses-ag", "LEAUsesAG", "true", |
| 234 | "LEA instruction needs inputs at AG stage">; |
Alexey Volkov | 6226de6 | 2014-05-20 08:55:50 +0000 | [diff] [blame] | 235 | def FeatureSlowLEA : SubtargetFeature<"slow-lea", "SlowLEA", "true", |
| 236 | "LEA instruction with certain arguments is slow">; |
Alexey Volkov | 5260dba | 2014-06-09 11:40:41 +0000 | [diff] [blame] | 237 | def FeatureSlowIncDec : SubtargetFeature<"slow-incdec", "SlowIncDec", "true", |
| 238 | "INC and DEC instructions are slower than ADD and SUB">; |
Eric Christopher | 824f42f | 2015-05-12 01:26:05 +0000 | [diff] [blame] | 239 | def FeatureSoftFloat |
| 240 | : SubtargetFeature<"soft-float", "UseSoftFloat", "true", |
| 241 | "Use software floating point features.">; |
Yunzhong Gao | 0de36ec | 2016-02-12 23:37:57 +0000 | [diff] [blame^] | 242 | // On at least some AMD processors, there is no performance hazard to writing |
| 243 | // only the lower parts of a YMM register without clearing the upper part. |
| 244 | def FeatureFastPartialYMMWrite |
| 245 | : SubtargetFeature<"fast-partial-ymm-write", "HasFastPartialYMMWrite", |
| 246 | "true", "Partial writes to YMM registers are fast">; |
David Greene | 8f6f72c | 2009-06-26 22:46:54 +0000 | [diff] [blame] | 247 | |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 248 | //===----------------------------------------------------------------------===// |
| 249 | // X86 processors supported. |
| 250 | //===----------------------------------------------------------------------===// |
| 251 | |
Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 252 | include "X86Schedule.td" |
| 253 | |
| 254 | def ProcIntelAtom : SubtargetFeature<"atom", "X86ProcFamily", "IntelAtom", |
| 255 | "Intel Atom processors">; |
Preston Gurd | 3fe264d | 2013-09-13 19:23:28 +0000 | [diff] [blame] | 256 | def ProcIntelSLM : SubtargetFeature<"slm", "X86ProcFamily", "IntelSLM", |
| 257 | "Intel Silvermont processors">; |
Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 258 | |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 259 | class Proc<string Name, list<SubtargetFeature> Features> |
Andrew Trick | 87255e3 | 2012-07-07 04:00:00 +0000 | [diff] [blame] | 260 | : ProcessorModel<Name, GenericModel, Features>; |
Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 261 | |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 262 | def : Proc<"generic", [FeatureSlowUAMem16]>; |
| 263 | def : Proc<"i386", [FeatureSlowUAMem16]>; |
| 264 | def : Proc<"i486", [FeatureSlowUAMem16]>; |
| 265 | def : Proc<"i586", [FeatureSlowUAMem16]>; |
| 266 | def : Proc<"pentium", [FeatureSlowUAMem16]>; |
| 267 | def : Proc<"pentium-mmx", [FeatureSlowUAMem16, FeatureMMX]>; |
| 268 | def : Proc<"i686", [FeatureSlowUAMem16]>; |
| 269 | def : Proc<"pentiumpro", [FeatureSlowUAMem16, FeatureCMOV]>; |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 270 | def : Proc<"pentium2", [FeatureSlowUAMem16, FeatureMMX, FeatureCMOV, |
| 271 | FeatureFXSR]>; |
| 272 | def : Proc<"pentium3", [FeatureSlowUAMem16, FeatureMMX, FeatureSSE1, |
| 273 | FeatureFXSR]>; |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 274 | def : Proc<"pentium3m", [FeatureSlowUAMem16, FeatureMMX, FeatureSSE1, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 275 | FeatureFXSR, FeatureSlowBTMem]>; |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 276 | def : Proc<"pentium-m", [FeatureSlowUAMem16, FeatureMMX, FeatureSSE2, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 277 | FeatureFXSR, FeatureSlowBTMem]>; |
| 278 | def : Proc<"pentium4", [FeatureSlowUAMem16, FeatureMMX, FeatureSSE2, |
| 279 | FeatureFXSR]>; |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 280 | def : Proc<"pentium4m", [FeatureSlowUAMem16, FeatureMMX, FeatureSSE2, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 281 | FeatureFXSR, FeatureSlowBTMem]>; |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 282 | |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 283 | // Intel Core Duo. |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 284 | def : ProcessorModel<"yonah", SandyBridgeModel, |
| 285 | [FeatureSlowUAMem16, FeatureMMX, FeatureSSE3, FeatureFXSR, |
| 286 | FeatureSlowBTMem]>; |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 287 | |
| 288 | // NetBurst. |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 289 | def : Proc<"prescott", |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 290 | [FeatureSlowUAMem16, FeatureMMX, FeatureSSE3, FeatureFXSR, |
| 291 | FeatureSlowBTMem]>; |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 292 | def : Proc<"nocona", [ |
| 293 | FeatureSlowUAMem16, |
| 294 | FeatureMMX, |
| 295 | FeatureSSE3, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 296 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 297 | FeatureCMPXCHG16B, |
| 298 | FeatureSlowBTMem |
| 299 | ]>; |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 300 | |
| 301 | // Intel Core 2 Solo/Duo. |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 302 | def : ProcessorModel<"core2", SandyBridgeModel, [ |
| 303 | FeatureSlowUAMem16, |
| 304 | FeatureMMX, |
| 305 | FeatureSSSE3, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 306 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 307 | FeatureCMPXCHG16B, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 308 | FeatureSlowBTMem, |
| 309 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 310 | ]>; |
| 311 | def : ProcessorModel<"penryn", SandyBridgeModel, [ |
| 312 | FeatureSlowUAMem16, |
| 313 | FeatureMMX, |
| 314 | FeatureSSE41, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 315 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 316 | FeatureCMPXCHG16B, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 317 | FeatureSlowBTMem, |
| 318 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 319 | ]>; |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 320 | |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 321 | // Atom CPUs. |
| 322 | class BonnellProc<string Name> : ProcessorModel<Name, AtomModel, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 323 | ProcIntelAtom, |
| 324 | FeatureSlowUAMem16, |
| 325 | FeatureMMX, |
| 326 | FeatureSSSE3, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 327 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 328 | FeatureCMPXCHG16B, |
| 329 | FeatureMOVBE, |
| 330 | FeatureSlowBTMem, |
Sanjay Patel | 53d1d8b | 2015-10-12 15:24:01 +0000 | [diff] [blame] | 331 | FeatureLEAForSP, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 332 | FeatureSlowDivide32, |
| 333 | FeatureSlowDivide64, |
| 334 | FeatureCallRegIndirect, |
| 335 | FeatureLEAUsesAG, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 336 | FeaturePadShortFunctions, |
| 337 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 338 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 339 | def : BonnellProc<"bonnell">; |
| 340 | def : BonnellProc<"atom">; // Pin the generic name to the baseline. |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 341 | |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 342 | class SilvermontProc<string Name> : ProcessorModel<Name, SLMModel, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 343 | ProcIntelSLM, |
| 344 | FeatureMMX, |
| 345 | FeatureSSE42, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 346 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 347 | FeatureCMPXCHG16B, |
| 348 | FeatureMOVBE, |
| 349 | FeaturePOPCNT, |
| 350 | FeaturePCLMUL, |
| 351 | FeatureAES, |
| 352 | FeatureSlowDivide64, |
| 353 | FeatureCallRegIndirect, |
| 354 | FeaturePRFCHW, |
| 355 | FeatureSlowLEA, |
| 356 | FeatureSlowIncDec, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 357 | FeatureSlowBTMem, |
| 358 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 359 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 360 | def : SilvermontProc<"silvermont">; |
| 361 | def : SilvermontProc<"slm">; // Legacy alias. |
| 362 | |
Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 363 | // "Arrandale" along with corei3 and corei5 |
Craig Topper | 3611d9b | 2015-03-30 06:31:11 +0000 | [diff] [blame] | 364 | class NehalemProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 365 | FeatureMMX, |
| 366 | FeatureSSE42, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 367 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 368 | FeatureCMPXCHG16B, |
| 369 | FeatureSlowBTMem, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 370 | FeaturePOPCNT, |
| 371 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 372 | ]>; |
Craig Topper | 3611d9b | 2015-03-30 06:31:11 +0000 | [diff] [blame] | 373 | def : NehalemProc<"nehalem">; |
| 374 | def : NehalemProc<"corei7">; |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 375 | |
Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 376 | // Westmere is a similar machine to nehalem with some additional features. |
| 377 | // Westmere is the corei3/i5/i7 path from nehalem to sandybridge |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 378 | class WestmereProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 379 | FeatureMMX, |
| 380 | FeatureSSE42, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 381 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 382 | FeatureCMPXCHG16B, |
| 383 | FeatureSlowBTMem, |
| 384 | FeaturePOPCNT, |
| 385 | FeatureAES, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 386 | FeaturePCLMUL, |
| 387 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 388 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 389 | def : WestmereProc<"westmere">; |
| 390 | |
Nate Begeman | 8b08f52 | 2010-12-10 00:26:57 +0000 | [diff] [blame] | 391 | // SSE is not listed here since llvm treats AVX as a reimplementation of SSE, |
| 392 | // rather than a superset. |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 393 | def ProcIntelSNB : SubtargetFeature<"snb", "X86ProcFamily", "IntelSNB", |
| 394 | " Intel SandyBridge Processor", [ |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 395 | FeatureMMX, |
| 396 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 397 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 398 | FeatureCMPXCHG16B, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 399 | FeaturePOPCNT, |
| 400 | FeatureAES, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 401 | FeaturePCLMUL, |
| 402 | FeatureXSAVE, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 403 | FeatureXSAVEOPT, |
| 404 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 405 | ]>; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 406 | |
| 407 | class SandyBridgeProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [ |
| 408 | ProcIntelSNB, |
| 409 | FeatureSlowBTMem, |
| 410 | FeatureSlowUAMem32 |
| 411 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 412 | def : SandyBridgeProc<"sandybridge">; |
| 413 | def : SandyBridgeProc<"corei7-avx">; // Legacy alias. |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 414 | |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 415 | def ProcIntelIVB : SubtargetFeature<"ivb", "X86ProcFamily", "IntelIVB", |
| 416 | " Intel IvyBridge Processor", [ |
| 417 | ProcIntelSNB, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 418 | FeatureRDRAND, |
| 419 | FeatureF16C, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 420 | FeatureFSGSBase |
| 421 | ]>; |
| 422 | |
| 423 | class IvyBridgeProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [ |
| 424 | ProcIntelIVB, |
| 425 | FeatureSlowBTMem, |
| 426 | FeatureSlowUAMem32 |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 427 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 428 | def : IvyBridgeProc<"ivybridge">; |
| 429 | def : IvyBridgeProc<"core-avx-i">; // Legacy alias. |
Craig Topper | 3657fe4 | 2011-10-14 03:21:46 +0000 | [diff] [blame] | 430 | |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 431 | def ProcIntelHSW : SubtargetFeature<"hsw", "X86ProcFamily", "IntelHSW", |
| 432 | " Intel Haswell Processor", [ |
| 433 | ProcIntelIVB, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 434 | FeatureAVX2, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 435 | FeatureBMI, |
| 436 | FeatureBMI2, |
| 437 | FeatureFMA, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 438 | FeatureLZCNT, |
| 439 | FeatureMOVBE, |
| 440 | FeatureINVPCID, |
| 441 | FeatureVMFUNC, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 442 | FeatureRTM, |
| 443 | FeatureHLE, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 444 | FeatureSlowIncDec |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 445 | ]>; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 446 | |
| 447 | class HaswellProc<string Name> : ProcessorModel<Name, HaswellModel, |
| 448 | [ProcIntelHSW]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 449 | def : HaswellProc<"haswell">; |
| 450 | def : HaswellProc<"core-avx2">; // Legacy alias. |
| 451 | |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 452 | def ProcIntelBDW : SubtargetFeature<"bdw", "X86ProcFamily", "IntelBDW", |
| 453 | " Intel Broadwell Processor", [ |
| 454 | ProcIntelHSW, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 455 | FeatureADX, |
| 456 | FeatureRDSEED, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 457 | FeatureSMAP |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 458 | ]>; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 459 | class BroadwellProc<string Name> : ProcessorModel<Name, HaswellModel, |
| 460 | [ProcIntelBDW]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 461 | def : BroadwellProc<"broadwell">; |
| 462 | |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 463 | def ProcIntelSKL : SubtargetFeature<"skl", "X86ProcFamily", "IntelSKL", |
| 464 | " Intel Skylake Client Processor", [ |
| 465 | ProcIntelBDW, |
| 466 | FeatureMPX, |
| 467 | FeatureXSAVEC, |
| 468 | FeatureXSAVES, |
| 469 | FeatureSGX, |
| 470 | FeatureCLFLUSHOPT |
| 471 | ]>; |
| 472 | |
| 473 | // FIXME: define SKL model |
| 474 | class SkylakeClientProc<string Name> : ProcessorModel<Name, HaswellModel, |
| 475 | [ProcIntelSKL]>; |
| 476 | def : SkylakeClientProc<"skl">; |
| 477 | |
Elena Demikhovsky | 8cfb43f | 2013-07-24 11:02:47 +0000 | [diff] [blame] | 478 | // FIXME: define KNL model |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 479 | class KnightsLandingProc<string Name> : ProcessorModel<Name, HaswellModel,[ |
| 480 | ProcIntelIVB, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 481 | FeatureAVX512, |
| 482 | FeatureERI, |
| 483 | FeatureCDI, |
| 484 | FeaturePFI, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 485 | FeaturePREFETCHWT1, |
| 486 | FeatureADX, |
| 487 | FeatureRDSEED, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 488 | FeatureMOVBE, |
| 489 | FeatureLZCNT, |
| 490 | FeatureBMI, |
| 491 | FeatureBMI2, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 492 | FeatureFMA |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 493 | ]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 494 | def : KnightsLandingProc<"knl">; |
Elena Demikhovsky | 8cfb43f | 2013-07-24 11:02:47 +0000 | [diff] [blame] | 495 | |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 496 | def ProcIntelSKX : SubtargetFeature<"skx", "X86ProcFamily", "IntelSKX", |
| 497 | " Intel Skylake Server Processor", [ |
| 498 | ProcIntelSKL, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 499 | FeatureAVX512, |
| 500 | FeatureCDI, |
| 501 | FeatureDQI, |
| 502 | FeatureBWI, |
| 503 | FeatureVLX, |
Asaf Badouh | 5acf66f | 2015-12-15 13:35:29 +0000 | [diff] [blame] | 504 | FeaturePKU, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 505 | FeaturePCOMMIT, |
| 506 | FeatureCLWB |
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 | |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 509 | // FIXME: define SKX model |
| 510 | class SkylakeServerProc<string Name> : ProcessorModel<Name, HaswellModel, |
| 511 | [ ProcIntelSKX]>; |
| 512 | def : SkylakeServerProc<"skylake">; |
| 513 | def : SkylakeServerProc<"skx">; // Legacy alias. |
| 514 | |
| 515 | def ProcIntelCNL : SubtargetFeature<"cnl", "X86ProcFamily", "IntelCNL", |
| 516 | " Intel Cannonlake Processor", [ |
| 517 | ProcIntelSKX, |
Elena Demikhovsky | 9242ea8 | 2016-01-18 13:00:31 +0000 | [diff] [blame] | 518 | FeatureVBMI, |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 519 | FeatureIFMA, |
| 520 | FeatureSHA |
Elena Demikhovsky | 9242ea8 | 2016-01-18 13:00:31 +0000 | [diff] [blame] | 521 | ]>; |
Elena Demikhovsky | 29cde35 | 2016-01-24 10:41:28 +0000 | [diff] [blame] | 522 | |
| 523 | class CannonlakeProc<string Name> : ProcessorModel<Name, HaswellModel, |
| 524 | [ ProcIntelCNL ]>; |
Elena Demikhovsky | 9242ea8 | 2016-01-18 13:00:31 +0000 | [diff] [blame] | 525 | def : CannonlakeProc<"cannonlake">; |
| 526 | def : CannonlakeProc<"cnl">; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 527 | |
| 528 | // AMD CPUs. |
Robert Khasanov | bfa0131 | 2014-07-21 14:54:21 +0000 | [diff] [blame] | 529 | |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 530 | def : Proc<"k6", [FeatureSlowUAMem16, FeatureMMX]>; |
| 531 | def : Proc<"k6-2", [FeatureSlowUAMem16, Feature3DNow]>; |
| 532 | def : Proc<"k6-3", [FeatureSlowUAMem16, Feature3DNow]>; |
| 533 | def : Proc<"athlon", [FeatureSlowUAMem16, Feature3DNowA, |
Sanjay Patel | 9e916dc | 2015-08-21 20:17:26 +0000 | [diff] [blame] | 534 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 535 | def : Proc<"athlon-tbird", [FeatureSlowUAMem16, Feature3DNowA, |
Sanjay Patel | 9e916dc | 2015-08-21 20:17:26 +0000 | [diff] [blame] | 536 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 537 | def : Proc<"athlon-4", [FeatureSlowUAMem16, FeatureSSE1, Feature3DNowA, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 538 | FeatureFXSR, FeatureSlowBTMem, FeatureSlowSHLD]>; |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 539 | def : Proc<"athlon-xp", [FeatureSlowUAMem16, FeatureSSE1, Feature3DNowA, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 540 | FeatureFXSR, FeatureSlowBTMem, FeatureSlowSHLD]>; |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 541 | def : Proc<"athlon-mp", [FeatureSlowUAMem16, FeatureSSE1, Feature3DNowA, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 542 | FeatureFXSR, FeatureSlowBTMem, FeatureSlowSHLD]>; |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 543 | def : Proc<"k8", [FeatureSlowUAMem16, FeatureSSE2, Feature3DNowA, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 544 | FeatureFXSR, Feature64Bit, FeatureSlowBTMem, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 545 | FeatureSlowSHLD]>; |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 546 | def : Proc<"opteron", [FeatureSlowUAMem16, FeatureSSE2, Feature3DNowA, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 547 | FeatureFXSR, Feature64Bit, FeatureSlowBTMem, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 548 | FeatureSlowSHLD]>; |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 549 | def : Proc<"athlon64", [FeatureSlowUAMem16, FeatureSSE2, Feature3DNowA, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 550 | FeatureFXSR, Feature64Bit, FeatureSlowBTMem, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 551 | FeatureSlowSHLD]>; |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 552 | def : Proc<"athlon-fx", [FeatureSlowUAMem16, FeatureSSE2, Feature3DNowA, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 553 | FeatureFXSR, Feature64Bit, FeatureSlowBTMem, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 554 | FeatureSlowSHLD]>; |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 555 | def : Proc<"k8-sse3", [FeatureSlowUAMem16, FeatureSSE3, Feature3DNowA, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 556 | FeatureFXSR, FeatureCMPXCHG16B, FeatureSlowBTMem, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 557 | FeatureSlowSHLD]>; |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 558 | def : Proc<"opteron-sse3", [FeatureSlowUAMem16, FeatureSSE3, Feature3DNowA, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 559 | FeatureFXSR, FeatureCMPXCHG16B, FeatureSlowBTMem, |
Sanjay Patel | 9e916dc | 2015-08-21 20:17:26 +0000 | [diff] [blame] | 560 | FeatureSlowSHLD]>; |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 561 | def : Proc<"athlon64-sse3", [FeatureSlowUAMem16, FeatureSSE3, Feature3DNowA, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 562 | FeatureFXSR, FeatureCMPXCHG16B, FeatureSlowBTMem, |
Sanjay Patel | 9e916dc | 2015-08-21 20:17:26 +0000 | [diff] [blame] | 563 | FeatureSlowSHLD]>; |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 564 | def : Proc<"amdfam10", [FeatureSSE4A, Feature3DNowA, FeatureFXSR, |
| 565 | FeatureCMPXCHG16B, FeatureLZCNT, FeaturePOPCNT, |
Hans Wennborg | fbf2822 | 2015-12-04 23:32:19 +0000 | [diff] [blame] | 566 | FeatureSlowBTMem, FeatureSlowSHLD, FeatureLAHFSAHF]>; |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 567 | def : Proc<"barcelona", [FeatureSSE4A, Feature3DNowA, FeatureFXSR, |
| 568 | FeatureCMPXCHG16B, FeatureLZCNT, FeaturePOPCNT, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 569 | FeatureSlowBTMem, FeatureSlowSHLD, FeatureLAHFSAHF]>; |
Sanjay Patel | 9e916dc | 2015-08-21 20:17:26 +0000 | [diff] [blame] | 570 | |
Benjamin Kramer | 077ae1d | 2012-01-10 11:50:02 +0000 | [diff] [blame] | 571 | // Bobcat |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 572 | def : Proc<"btver1", [ |
| 573 | FeatureMMX, |
| 574 | FeatureSSSE3, |
| 575 | FeatureSSE4A, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 576 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 577 | FeatureCMPXCHG16B, |
| 578 | FeaturePRFCHW, |
| 579 | FeatureLZCNT, |
| 580 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 581 | FeatureXSAVE, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 582 | FeatureSlowSHLD, |
| 583 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 584 | ]>; |
Sanjay Patel | 1191adf | 2014-09-09 20:07:07 +0000 | [diff] [blame] | 585 | |
Benjamin Kramer | b44c427 | 2013-05-03 10:20:08 +0000 | [diff] [blame] | 586 | // Jaguar |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 587 | def : ProcessorModel<"btver2", BtVer2Model, [ |
| 588 | FeatureMMX, |
| 589 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 590 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 591 | FeatureSSE4A, |
| 592 | FeatureCMPXCHG16B, |
| 593 | FeaturePRFCHW, |
| 594 | FeatureAES, |
| 595 | FeaturePCLMUL, |
| 596 | FeatureBMI, |
| 597 | FeatureF16C, |
| 598 | FeatureMOVBE, |
| 599 | FeatureLZCNT, |
| 600 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 601 | FeatureXSAVE, |
| 602 | FeatureXSAVEOPT, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 603 | FeatureSlowSHLD, |
Yunzhong Gao | 0de36ec | 2016-02-12 23:37:57 +0000 | [diff] [blame^] | 604 | FeatureLAHFSAHF, |
| 605 | FeatureFastPartialYMMWrite |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 606 | ]>; |
Sanjay Patel | e57f3c0 | 2014-11-28 18:40:18 +0000 | [diff] [blame] | 607 | |
Benjamin Kramer | 077ae1d | 2012-01-10 11:50:02 +0000 | [diff] [blame] | 608 | // Bulldozer |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 609 | def : Proc<"bdver1", [ |
| 610 | FeatureXOP, |
| 611 | FeatureFMA4, |
| 612 | FeatureCMPXCHG16B, |
| 613 | FeatureAES, |
| 614 | FeaturePRFCHW, |
| 615 | FeaturePCLMUL, |
| 616 | FeatureMMX, |
| 617 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 618 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 619 | FeatureSSE4A, |
| 620 | FeatureLZCNT, |
| 621 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 622 | FeatureXSAVE, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 623 | FeatureSlowSHLD, |
| 624 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 625 | ]>; |
Benjamin Kramer | b44c427 | 2013-05-03 10:20:08 +0000 | [diff] [blame] | 626 | // Piledriver |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 627 | def : Proc<"bdver2", [ |
| 628 | FeatureXOP, |
| 629 | FeatureFMA4, |
| 630 | FeatureCMPXCHG16B, |
| 631 | FeatureAES, |
| 632 | FeaturePRFCHW, |
| 633 | FeaturePCLMUL, |
| 634 | FeatureMMX, |
| 635 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 636 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 637 | FeatureSSE4A, |
| 638 | FeatureF16C, |
| 639 | FeatureLZCNT, |
| 640 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 641 | FeatureXSAVE, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 642 | FeatureBMI, |
| 643 | FeatureTBM, |
| 644 | FeatureFMA, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 645 | FeatureSlowSHLD, |
| 646 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 647 | ]>; |
Benjamin Kramer | d114def | 2013-11-04 10:29:20 +0000 | [diff] [blame] | 648 | |
| 649 | // Steamroller |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 650 | def : Proc<"bdver3", [ |
| 651 | FeatureXOP, |
| 652 | FeatureFMA4, |
| 653 | FeatureCMPXCHG16B, |
| 654 | FeatureAES, |
| 655 | FeaturePRFCHW, |
| 656 | FeaturePCLMUL, |
| 657 | FeatureMMX, |
| 658 | FeatureAVX, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 659 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 660 | FeatureSSE4A, |
| 661 | FeatureF16C, |
| 662 | FeatureLZCNT, |
| 663 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 664 | FeatureXSAVE, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 665 | FeatureBMI, |
| 666 | FeatureTBM, |
| 667 | FeatureFMA, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 668 | FeatureXSAVEOPT, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 669 | FeatureSlowSHLD, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 670 | FeatureFSGSBase, |
| 671 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 672 | ]>; |
Benjamin Kramer | d114def | 2013-11-04 10:29:20 +0000 | [diff] [blame] | 673 | |
Benjamin Kramer | 6004573 | 2014-05-02 15:47:07 +0000 | [diff] [blame] | 674 | // Excavator |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 675 | def : Proc<"bdver4", [ |
| 676 | FeatureMMX, |
| 677 | FeatureAVX2, |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 678 | FeatureFXSR, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 679 | FeatureXOP, |
| 680 | FeatureFMA4, |
| 681 | FeatureCMPXCHG16B, |
| 682 | FeatureAES, |
| 683 | FeaturePRFCHW, |
| 684 | FeaturePCLMUL, |
| 685 | FeatureF16C, |
| 686 | FeatureLZCNT, |
| 687 | FeaturePOPCNT, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 688 | FeatureXSAVE, |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 689 | FeatureBMI, |
| 690 | FeatureBMI2, |
| 691 | FeatureTBM, |
| 692 | FeatureFMA, |
Craig Topper | 0ee3569 | 2015-10-14 05:37:38 +0000 | [diff] [blame] | 693 | FeatureXSAVEOPT, |
Hans Wennborg | 5000ce8 | 2015-12-04 23:00:33 +0000 | [diff] [blame] | 694 | FeatureFSGSBase, |
| 695 | FeatureLAHFSAHF |
Eric Christopher | 11e5983 | 2015-10-08 20:10:06 +0000 | [diff] [blame] | 696 | ]>; |
Benjamin Kramer | 6004573 | 2014-05-02 15:47:07 +0000 | [diff] [blame] | 697 | |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 698 | def : Proc<"geode", [FeatureSlowUAMem16, Feature3DNowA]>; |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 699 | |
Sanjay Patel | 3014567 | 2015-09-01 20:51:51 +0000 | [diff] [blame] | 700 | def : Proc<"winchip-c6", [FeatureSlowUAMem16, FeatureMMX]>; |
| 701 | def : Proc<"winchip2", [FeatureSlowUAMem16, Feature3DNow]>; |
| 702 | def : Proc<"c3", [FeatureSlowUAMem16, Feature3DNow]>; |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 703 | def : Proc<"c3-2", [FeatureSlowUAMem16, FeatureMMX, FeatureSSE1, FeatureFXSR]>; |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 704 | |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 705 | // We also provide a generic 64-bit specific x86 processor model which tries to |
| 706 | // be good for modern chips without enabling instruction set encodings past the |
| 707 | // basic SSE2 and 64-bit ones. It disables slow things from any mainstream and |
| 708 | // modern 64-bit x86 chip, and enables features that are generally beneficial. |
Michael Liao | 5bf9578 | 2014-12-04 05:20:33 +0000 | [diff] [blame] | 709 | // |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 710 | // We currently use the Sandy Bridge model as the default scheduling model as |
| 711 | // we use it across Nehalem, Westmere, Sandy Bridge, and Ivy Bridge which |
| 712 | // covers a huge swath of x86 processors. If there are specific scheduling |
| 713 | // knobs which need to be tuned differently for AMD chips, we might consider |
| 714 | // forming a common base for them. |
Craig Topper | 09b6598 | 2015-10-16 06:03:09 +0000 | [diff] [blame] | 715 | def : ProcessorModel<"x86-64", SandyBridgeModel, |
| 716 | [FeatureMMX, FeatureSSE2, FeatureFXSR, Feature64Bit, |
| 717 | FeatureSlowBTMem ]>; |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 718 | |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 719 | //===----------------------------------------------------------------------===// |
Chris Lattner | 5da8e80 | 2003-08-03 15:47:49 +0000 | [diff] [blame] | 720 | // Register File Description |
| 721 | //===----------------------------------------------------------------------===// |
| 722 | |
| 723 | include "X86RegisterInfo.td" |
| 724 | |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 725 | //===----------------------------------------------------------------------===// |
| 726 | // Instruction Descriptions |
| 727 | //===----------------------------------------------------------------------===// |
| 728 | |
Chris Lattner | 59a4a91 | 2003-08-03 21:54:21 +0000 | [diff] [blame] | 729 | include "X86InstrInfo.td" |
| 730 | |
Jakob Stoklund Olesen | b93331f | 2010-04-05 03:10:20 +0000 | [diff] [blame] | 731 | def X86InstrInfo : InstrInfo; |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 732 | |
Chris Lattner | 5d00a0b | 2007-02-26 18:17:14 +0000 | [diff] [blame] | 733 | //===----------------------------------------------------------------------===// |
| 734 | // Calling Conventions |
| 735 | //===----------------------------------------------------------------------===// |
| 736 | |
| 737 | include "X86CallingConv.td" |
| 738 | |
| 739 | |
| 740 | //===----------------------------------------------------------------------===// |
Jim Grosbach | 4cf25f5 | 2010-10-30 13:48:28 +0000 | [diff] [blame] | 741 | // Assembly Parser |
Chris Lattner | 5d00a0b | 2007-02-26 18:17:14 +0000 | [diff] [blame] | 742 | //===----------------------------------------------------------------------===// |
| 743 | |
Devang Patel | 85d684a | 2012-01-09 19:13:28 +0000 | [diff] [blame] | 744 | def ATTAsmParserVariant : AsmParserVariant { |
Daniel Dunbar | 0033199 | 2009-07-29 00:02:19 +0000 | [diff] [blame] | 745 | int Variant = 0; |
Daniel Dunbar | e431871 | 2009-08-11 20:59:47 +0000 | [diff] [blame] | 746 | |
Chad Rosier | 9f7a221 | 2013-04-18 22:35:36 +0000 | [diff] [blame] | 747 | // Variant name. |
| 748 | string Name = "att"; |
| 749 | |
Daniel Dunbar | e431871 | 2009-08-11 20:59:47 +0000 | [diff] [blame] | 750 | // Discard comments in assembly strings. |
| 751 | string CommentDelimiter = "#"; |
| 752 | |
| 753 | // Recognize hard coded registers. |
| 754 | string RegisterPrefix = "%"; |
Daniel Dunbar | 0033199 | 2009-07-29 00:02:19 +0000 | [diff] [blame] | 755 | } |
| 756 | |
Devang Patel | 67bf992a | 2012-01-10 17:51:54 +0000 | [diff] [blame] | 757 | def IntelAsmParserVariant : AsmParserVariant { |
| 758 | int Variant = 1; |
| 759 | |
Chad Rosier | 9f7a221 | 2013-04-18 22:35:36 +0000 | [diff] [blame] | 760 | // Variant name. |
| 761 | string Name = "intel"; |
| 762 | |
Devang Patel | 67bf992a | 2012-01-10 17:51:54 +0000 | [diff] [blame] | 763 | // Discard comments in assembly strings. |
| 764 | string CommentDelimiter = ";"; |
| 765 | |
| 766 | // Recognize hard coded registers. |
| 767 | string RegisterPrefix = ""; |
| 768 | } |
| 769 | |
Jim Grosbach | 4cf25f5 | 2010-10-30 13:48:28 +0000 | [diff] [blame] | 770 | //===----------------------------------------------------------------------===// |
| 771 | // Assembly Printers |
| 772 | //===----------------------------------------------------------------------===// |
| 773 | |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 774 | // The X86 target supports two different syntaxes for emitting machine code. |
| 775 | // This is controlled by the -x86-asm-syntax={att|intel} |
| 776 | def ATTAsmWriter : AsmWriter { |
Chris Lattner | 1cbd3de | 2009-09-13 19:30:11 +0000 | [diff] [blame] | 777 | string AsmWriterClassName = "ATTInstPrinter"; |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 778 | int Variant = 0; |
| 779 | } |
| 780 | def IntelAsmWriter : AsmWriter { |
Chris Lattner | 13306a1 | 2009-09-20 07:47:59 +0000 | [diff] [blame] | 781 | string AsmWriterClassName = "IntelInstPrinter"; |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 782 | int Variant = 1; |
| 783 | } |
| 784 | |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 785 | def X86 : Target { |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 786 | // Information about the instructions... |
Chris Lattner | 2551080 | 2003-08-04 04:59:56 +0000 | [diff] [blame] | 787 | let InstructionSet = X86InstrInfo; |
Devang Patel | 67bf992a | 2012-01-10 17:51:54 +0000 | [diff] [blame] | 788 | let AssemblyParserVariants = [ATTAsmParserVariant, IntelAsmParserVariant]; |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 789 | let AssemblyWriters = [ATTAsmWriter, IntelAsmWriter]; |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 790 | } |