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