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 | |
David Greene | 206351a | 2010-01-11 16:29:42 +0000 | [diff] [blame] | 40 | |
Bill Wendling | e618226 | 2007-05-04 20:38:40 +0000 | [diff] [blame] | 41 | def FeatureMMX : SubtargetFeature<"mmx","X86SSELevel", "MMX", |
| 42 | "Enable MMX instructions">; |
| 43 | def FeatureSSE1 : SubtargetFeature<"sse", "X86SSELevel", "SSE1", |
| 44 | "Enable SSE instructions", |
Chris Lattner | cc8c581 | 2009-09-02 05:53:04 +0000 | [diff] [blame] | 45 | // SSE codegen depends on cmovs, and all |
Michael J. Spencer | b88784c | 2011-04-14 14:33:36 +0000 | [diff] [blame] | 46 | // SSE1+ processors support them. |
Chris Lattner | cc8c581 | 2009-09-02 05:53:04 +0000 | [diff] [blame] | 47 | [FeatureMMX, FeatureCMOV]>; |
Bill Wendling | e618226 | 2007-05-04 20:38:40 +0000 | [diff] [blame] | 48 | def FeatureSSE2 : SubtargetFeature<"sse2", "X86SSELevel", "SSE2", |
| 49 | "Enable SSE2 instructions", |
| 50 | [FeatureSSE1]>; |
| 51 | def FeatureSSE3 : SubtargetFeature<"sse3", "X86SSELevel", "SSE3", |
| 52 | "Enable SSE3 instructions", |
| 53 | [FeatureSSE2]>; |
| 54 | def FeatureSSSE3 : SubtargetFeature<"ssse3", "X86SSELevel", "SSSE3", |
| 55 | "Enable SSSE3 instructions", |
| 56 | [FeatureSSE3]>; |
Rafael Espindola | 94a2c56 | 2013-08-23 20:21:34 +0000 | [diff] [blame] | 57 | def FeatureSSE41 : SubtargetFeature<"sse4.1", "X86SSELevel", "SSE41", |
Nate Begeman | e14fdfa | 2008-02-03 07:18:54 +0000 | [diff] [blame] | 58 | "Enable SSE 4.1 instructions", |
| 59 | [FeatureSSSE3]>; |
Rafael Espindola | 94a2c56 | 2013-08-23 20:21:34 +0000 | [diff] [blame] | 60 | def FeatureSSE42 : SubtargetFeature<"sse4.2", "X86SSELevel", "SSE42", |
Nate Begeman | e14fdfa | 2008-02-03 07:18:54 +0000 | [diff] [blame] | 61 | "Enable SSE 4.2 instructions", |
Craig Topper | 7bd3305 | 2011-12-29 15:51:45 +0000 | [diff] [blame] | 62 | [FeatureSSE41]>; |
Bill Wendling | e618226 | 2007-05-04 20:38:40 +0000 | [diff] [blame] | 63 | def Feature3DNow : SubtargetFeature<"3dnow", "X863DNowLevel", "ThreeDNow", |
Michael J. Spencer | 30088ba | 2011-04-15 00:32:41 +0000 | [diff] [blame] | 64 | "Enable 3DNow! instructions", |
| 65 | [FeatureMMX]>; |
Bill Wendling | e618226 | 2007-05-04 20:38:40 +0000 | [diff] [blame] | 66 | def Feature3DNowA : SubtargetFeature<"3dnowa", "X863DNowLevel", "ThreeDNowA", |
Bill Wendling | f985c49 | 2007-05-06 07:56:19 +0000 | [diff] [blame] | 67 | "Enable 3DNow! Athlon instructions", |
| 68 | [Feature3DNow]>; |
Dan Gohman | 7403751 | 2009-02-03 00:04:43 +0000 | [diff] [blame] | 69 | // All x86-64 hardware has SSE2, but we don't mark SSE2 as an implied |
| 70 | // feature, because SSE2 can be disabled (e.g. for compiling OS kernels) |
| 71 | // without disabling 64-bit mode. |
Bill Wendling | f985c49 | 2007-05-06 07:56:19 +0000 | [diff] [blame] | 72 | def Feature64Bit : SubtargetFeature<"64bit", "HasX86_64", "true", |
Chris Lattner | 77f7dba | 2010-03-14 22:24:34 +0000 | [diff] [blame] | 73 | "Support 64-bit instructions", |
| 74 | [FeatureCMOV]>; |
Nick Lewycky | 3be42b8 | 2013-10-05 20:11:44 +0000 | [diff] [blame] | 75 | def FeatureCMPXCHG16B : SubtargetFeature<"cx16", "HasCmpxchg16b", "true", |
Eli Friedman | 5e57042 | 2011-08-26 21:21:21 +0000 | [diff] [blame] | 76 | "64-bit with cmpxchg16b", |
| 77 | [Feature64Bit]>; |
Evan Cheng | 4c91aa3 | 2009-01-02 05:35:45 +0000 | [diff] [blame] | 78 | def FeatureSlowBTMem : SubtargetFeature<"slow-bt-mem", "IsBTMemSlow", "true", |
| 79 | "Bit testing of memory is slow">; |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 80 | def FeatureSlowSHLD : SubtargetFeature<"slow-shld", "IsSHLDSlow", "true", |
| 81 | "SHLD instruction is slow">; |
Sanjay Patel | e57f3c0 | 2014-11-28 18:40:18 +0000 | [diff] [blame] | 82 | // FIXME: This is a 16-byte (SSE/AVX) feature; we should rename it to make that |
| 83 | // explicit. Also, it seems this would be the default state for most chips |
| 84 | // going forward, so it would probably be better to negate the logic and |
| 85 | // match the 32-byte "slow mem" feature below. |
Evan Cheng | 738b0f9 | 2010-04-01 05:58:17 +0000 | [diff] [blame] | 86 | def FeatureFastUAMem : SubtargetFeature<"fast-unaligned-mem", |
| 87 | "IsUAMemFast", "true", |
| 88 | "Fast unaligned memory access">; |
Sanjay Patel | 501890e | 2014-11-21 17:40:04 +0000 | [diff] [blame] | 89 | def FeatureSlowUAMem32 : SubtargetFeature<"slow-unaligned-mem-32", |
| 90 | "IsUAMem32Slow", "true", |
| 91 | "Slow unaligned 32-byte memory access">; |
Stefanus Du Toit | 96180b5 | 2009-05-26 21:04:35 +0000 | [diff] [blame] | 92 | def FeatureSSE4A : SubtargetFeature<"sse4a", "HasSSE4A", "true", |
Craig Topper | a5d1fc2 | 2011-12-30 07:16:00 +0000 | [diff] [blame] | 93 | "Support SSE 4a instructions", |
| 94 | [FeatureSSE3]>; |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 95 | |
Craig Topper | f287a45 | 2012-01-09 09:02:13 +0000 | [diff] [blame] | 96 | def FeatureAVX : SubtargetFeature<"avx", "X86SSELevel", "AVX", |
| 97 | "Enable AVX instructions", |
| 98 | [FeatureSSE42]>; |
| 99 | def FeatureAVX2 : SubtargetFeature<"avx2", "X86SSELevel", "AVX2", |
Craig Topper | 228d913 | 2011-10-30 19:57:21 +0000 | [diff] [blame] | 100 | "Enable AVX2 instructions", |
| 101 | [FeatureAVX]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 102 | def FeatureAVX512 : SubtargetFeature<"avx512f", "X86SSELevel", "AVX512F", |
Elena Demikhovsky | 8cfb43f | 2013-07-24 11:02:47 +0000 | [diff] [blame] | 103 | "Enable AVX-512 instructions", |
| 104 | [FeatureAVX2]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 105 | def FeatureERI : SubtargetFeature<"avx512er", "HasERI", "true", |
Elena Demikhovsky | 003e7d7 | 2013-07-28 08:28:38 +0000 | [diff] [blame] | 106 | "Enable AVX-512 Exponential and Reciprocal Instructions", |
| 107 | [FeatureAVX512]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 108 | def FeatureCDI : SubtargetFeature<"avx512cd", "HasCDI", "true", |
Elena Demikhovsky | 003e7d7 | 2013-07-28 08:28:38 +0000 | [diff] [blame] | 109 | "Enable AVX-512 Conflict Detection Instructions", |
| 110 | [FeatureAVX512]>; |
Craig Topper | 5c94bb8 | 2013-08-21 03:57:57 +0000 | [diff] [blame] | 111 | def FeaturePFI : SubtargetFeature<"avx512pf", "HasPFI", "true", |
Elena Demikhovsky | 003e7d7 | 2013-07-28 08:28:38 +0000 | [diff] [blame] | 112 | "Enable AVX-512 PreFetch Instructions", |
| 113 | [FeatureAVX512]>; |
Robert Khasanov | bfa0131 | 2014-07-21 14:54:21 +0000 | [diff] [blame] | 114 | def FeatureDQI : SubtargetFeature<"avx512dq", "HasDQI", "true", |
| 115 | "Enable AVX-512 Doubleword and Quadword Instructions", |
| 116 | [FeatureAVX512]>; |
| 117 | def FeatureBWI : SubtargetFeature<"avx512bw", "HasBWI", "true", |
| 118 | "Enable AVX-512 Byte and Word Instructions", |
| 119 | [FeatureAVX512]>; |
| 120 | def FeatureVLX : SubtargetFeature<"avx512vl", "HasVLX", "true", |
| 121 | "Enable AVX-512 Vector Length eXtensions", |
| 122 | [FeatureAVX512]>; |
Benjamin Kramer | a0396e4 | 2012-05-31 14:34:17 +0000 | [diff] [blame] | 123 | def FeaturePCLMUL : SubtargetFeature<"pclmul", "HasPCLMUL", "true", |
| 124 | "Enable packed carry-less multiplication instructions", |
Craig Topper | 29dd148 | 2012-05-01 05:28:32 +0000 | [diff] [blame] | 125 | [FeatureSSE2]>; |
Craig Topper | 79dbb0c | 2012-06-03 18:58:46 +0000 | [diff] [blame] | 126 | def FeatureFMA : SubtargetFeature<"fma", "HasFMA", "true", |
Craig Topper | e1bd051 | 2011-12-29 19:46:19 +0000 | [diff] [blame] | 127 | "Enable three-operand fused multiple-add", |
| 128 | [FeatureAVX]>; |
David Greene | 8f6f72c | 2009-06-26 22:46:54 +0000 | [diff] [blame] | 129 | def FeatureFMA4 : SubtargetFeature<"fma4", "HasFMA4", "true", |
Craig Topper | a5d1fc2 | 2011-12-30 07:16:00 +0000 | [diff] [blame] | 130 | "Enable four-operand fused multiple-add", |
Craig Topper | bae0e9e | 2012-05-01 06:54:48 +0000 | [diff] [blame] | 131 | [FeatureAVX, FeatureSSE4A]>; |
Craig Topper | a5d1fc2 | 2011-12-30 07:16:00 +0000 | [diff] [blame] | 132 | def FeatureXOP : SubtargetFeature<"xop", "HasXOP", "true", |
Craig Topper | 43518cc | 2012-05-01 05:41:41 +0000 | [diff] [blame] | 133 | "Enable XOP instructions", |
Anitha Boyapati | af3e983 | 2012-08-16 04:04:02 +0000 | [diff] [blame] | 134 | [FeatureFMA4]>; |
Sanjay Patel | ffd039b | 2015-02-03 17:13:04 +0000 | [diff] [blame] | 135 | def FeatureSSEUnalignedMem : SubtargetFeature<"sse-unaligned-mem", |
| 136 | "HasSSEUnalignedMem", "true", |
| 137 | "Allow unaligned memory operands with SSE instructions">; |
Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 138 | def FeatureAES : SubtargetFeature<"aes", "HasAES", "true", |
Craig Topper | 29dd148 | 2012-05-01 05:28:32 +0000 | [diff] [blame] | 139 | "Enable AES instructions", |
| 140 | [FeatureSSE2]>; |
Yunzhong Gao | dd36e93 | 2013-09-24 18:21:52 +0000 | [diff] [blame] | 141 | def FeatureTBM : SubtargetFeature<"tbm", "HasTBM", "true", |
| 142 | "Enable TBM instructions">; |
Craig Topper | 786bdb9 | 2011-10-03 17:28:23 +0000 | [diff] [blame] | 143 | def FeatureMOVBE : SubtargetFeature<"movbe", "HasMOVBE", "true", |
| 144 | "Support MOVBE instruction">; |
Rafael Espindola | 94a2c56 | 2013-08-23 20:21:34 +0000 | [diff] [blame] | 145 | def FeatureRDRAND : SubtargetFeature<"rdrnd", "HasRDRAND", "true", |
Craig Topper | 786bdb9 | 2011-10-03 17:28:23 +0000 | [diff] [blame] | 146 | "Support RDRAND instruction">; |
Craig Topper | fe9179f | 2011-10-09 07:31:39 +0000 | [diff] [blame] | 147 | def FeatureF16C : SubtargetFeature<"f16c", "HasF16C", "true", |
Craig Topper | a6d204e | 2013-09-16 04:29:58 +0000 | [diff] [blame] | 148 | "Support 16-bit floating point conversion instructions", |
| 149 | [FeatureAVX]>; |
Craig Topper | 228d913 | 2011-10-30 19:57:21 +0000 | [diff] [blame] | 150 | def FeatureFSGSBase : SubtargetFeature<"fsgsbase", "HasFSGSBase", "true", |
| 151 | "Support FS/GS Base instructions">; |
Craig Topper | 271064e | 2011-10-11 06:44:02 +0000 | [diff] [blame] | 152 | def FeatureLZCNT : SubtargetFeature<"lzcnt", "HasLZCNT", "true", |
| 153 | "Support LZCNT instruction">; |
Craig Topper | 3657fe4 | 2011-10-14 03:21:46 +0000 | [diff] [blame] | 154 | def FeatureBMI : SubtargetFeature<"bmi", "HasBMI", "true", |
| 155 | "Support BMI instructions">; |
Craig Topper | aea148c | 2011-10-16 07:55:05 +0000 | [diff] [blame] | 156 | def FeatureBMI2 : SubtargetFeature<"bmi2", "HasBMI2", "true", |
| 157 | "Support BMI2 instructions">; |
Michael Liao | 73cffdd | 2012-11-08 07:28:54 +0000 | [diff] [blame] | 158 | def FeatureRTM : SubtargetFeature<"rtm", "HasRTM", "true", |
| 159 | "Support RTM instructions">; |
Michael Liao | e344ec9 | 2013-03-26 22:46:02 +0000 | [diff] [blame] | 160 | def FeatureHLE : SubtargetFeature<"hle", "HasHLE", "true", |
| 161 | "Support HLE">; |
Kay Tiong Khoo | f809c64 | 2013-02-14 19:08:21 +0000 | [diff] [blame] | 162 | def FeatureADX : SubtargetFeature<"adx", "HasADX", "true", |
| 163 | "Support ADX instructions">; |
Ben Langmuir | 1650175 | 2013-09-12 15:51:31 +0000 | [diff] [blame] | 164 | def FeatureSHA : SubtargetFeature<"sha", "HasSHA", "true", |
| 165 | "Enable SHA instructions", |
| 166 | [FeatureSSE2]>; |
Michael Liao | 5173ee0 | 2013-03-26 17:47:11 +0000 | [diff] [blame] | 167 | def FeaturePRFCHW : SubtargetFeature<"prfchw", "HasPRFCHW", "true", |
| 168 | "Support PRFCHW instructions">; |
Michael Liao | a486a11 | 2013-03-28 23:41:26 +0000 | [diff] [blame] | 169 | def FeatureRDSEED : SubtargetFeature<"rdseed", "HasRDSEED", "true", |
| 170 | "Support RDSEED instruction">; |
Elena Demikhovsky | f7e641c | 2015-06-03 10:30:57 +0000 | [diff] [blame] | 171 | def FeatureMPX : SubtargetFeature<"mpx", "HasMPX", "true", |
| 172 | "Support MPX instructions">; |
Evan Cheng | 1b81fdd | 2012-02-07 22:50:41 +0000 | [diff] [blame] | 173 | def FeatureLeaForSP : SubtargetFeature<"lea-sp", "UseLeaForSP", "true", |
| 174 | "Use LEA for adjusting the stack pointer">; |
Alexey Volkov | fd1731d | 2014-11-21 11:19:34 +0000 | [diff] [blame] | 175 | def FeatureSlowDivide32 : SubtargetFeature<"idivl-to-divb", |
| 176 | "HasSlowDivide32", "true", |
| 177 | "Use 8-bit divide for positive values less than 256">; |
| 178 | def FeatureSlowDivide64 : SubtargetFeature<"idivq-to-divw", |
| 179 | "HasSlowDivide64", "true", |
| 180 | "Use 16-bit divide for positive values less than 65536">; |
Preston Gurd | a01daac | 2013-01-08 18:27:24 +0000 | [diff] [blame] | 181 | def FeaturePadShortFunctions : SubtargetFeature<"pad-short-functions", |
| 182 | "PadShortFunctions", "true", |
| 183 | "Pad short functions">; |
Preston Gurd | 663e6f9 | 2013-03-27 19:14:02 +0000 | [diff] [blame] | 184 | def FeatureCallRegIndirect : SubtargetFeature<"call-reg-indirect", |
| 185 | "CallRegIndirect", "true", |
| 186 | "Call register indirect">; |
Preston Gurd | 8b7ab4b | 2013-04-25 20:29:37 +0000 | [diff] [blame] | 187 | def FeatureLEAUsesAG : SubtargetFeature<"lea-uses-ag", "LEAUsesAG", "true", |
| 188 | "LEA instruction needs inputs at AG stage">; |
Alexey Volkov | 6226de6 | 2014-05-20 08:55:50 +0000 | [diff] [blame] | 189 | def FeatureSlowLEA : SubtargetFeature<"slow-lea", "SlowLEA", "true", |
| 190 | "LEA instruction with certain arguments is slow">; |
Alexey Volkov | 5260dba | 2014-06-09 11:40:41 +0000 | [diff] [blame] | 191 | def FeatureSlowIncDec : SubtargetFeature<"slow-incdec", "SlowIncDec", "true", |
| 192 | "INC and DEC instructions are slower than ADD and SUB">; |
Eric Christopher | 824f42f | 2015-05-12 01:26:05 +0000 | [diff] [blame] | 193 | def FeatureSoftFloat |
| 194 | : SubtargetFeature<"soft-float", "UseSoftFloat", "true", |
| 195 | "Use software floating point features.">; |
David Greene | 8f6f72c | 2009-06-26 22:46:54 +0000 | [diff] [blame] | 196 | |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 197 | //===----------------------------------------------------------------------===// |
| 198 | // X86 processors supported. |
| 199 | //===----------------------------------------------------------------------===// |
| 200 | |
Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 201 | include "X86Schedule.td" |
| 202 | |
| 203 | def ProcIntelAtom : SubtargetFeature<"atom", "X86ProcFamily", "IntelAtom", |
| 204 | "Intel Atom processors">; |
Preston Gurd | 3fe264d | 2013-09-13 19:23:28 +0000 | [diff] [blame] | 205 | def ProcIntelSLM : SubtargetFeature<"slm", "X86ProcFamily", "IntelSLM", |
| 206 | "Intel Silvermont processors">; |
Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 207 | |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 208 | class Proc<string Name, list<SubtargetFeature> Features> |
Andrew Trick | 87255e3 | 2012-07-07 04:00:00 +0000 | [diff] [blame] | 209 | : ProcessorModel<Name, GenericModel, Features>; |
Andrew Trick | 8523b16 | 2012-02-01 23:20:51 +0000 | [diff] [blame] | 210 | |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 211 | def : Proc<"generic", []>; |
| 212 | def : Proc<"i386", []>; |
| 213 | def : Proc<"i486", []>; |
Dale Johannesen | 2810675 | 2008-10-14 22:06:33 +0000 | [diff] [blame] | 214 | def : Proc<"i586", []>; |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 215 | def : Proc<"pentium", []>; |
| 216 | def : Proc<"pentium-mmx", [FeatureMMX]>; |
| 217 | def : Proc<"i686", []>; |
Chris Lattner | cc8c581 | 2009-09-02 05:53:04 +0000 | [diff] [blame] | 218 | def : Proc<"pentiumpro", [FeatureCMOV]>; |
| 219 | def : Proc<"pentium2", [FeatureMMX, FeatureCMOV]>; |
Bill Wendling | 3fb7fdf | 2007-05-22 05:15:37 +0000 | [diff] [blame] | 220 | def : Proc<"pentium3", [FeatureSSE1]>; |
Michael J. Spencer | 9973738 | 2011-05-03 03:42:50 +0000 | [diff] [blame] | 221 | def : Proc<"pentium3m", [FeatureSSE1, FeatureSlowBTMem]>; |
Evan Cheng | 4c91aa3 | 2009-01-02 05:35:45 +0000 | [diff] [blame] | 222 | def : Proc<"pentium-m", [FeatureSSE2, FeatureSlowBTMem]>; |
Bill Wendling | 3fb7fdf | 2007-05-22 05:15:37 +0000 | [diff] [blame] | 223 | def : Proc<"pentium4", [FeatureSSE2]>; |
Michael J. Spencer | 9973738 | 2011-05-03 03:42:50 +0000 | [diff] [blame] | 224 | def : Proc<"pentium4m", [FeatureSSE2, FeatureSlowBTMem]>; |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 225 | |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 226 | // Intel Core Duo. |
| 227 | def : ProcessorModel<"yonah", SandyBridgeModel, |
| 228 | [FeatureSSE3, FeatureSlowBTMem]>; |
| 229 | |
| 230 | // NetBurst. |
| 231 | def : Proc<"prescott", [FeatureSSE3, FeatureSlowBTMem]>; |
| 232 | def : Proc<"nocona", [FeatureSSE3, FeatureCMPXCHG16B, FeatureSlowBTMem]>; |
| 233 | |
| 234 | // Intel Core 2 Solo/Duo. |
| 235 | def : ProcessorModel<"core2", SandyBridgeModel, |
| 236 | [FeatureSSSE3, FeatureCMPXCHG16B, FeatureSlowBTMem]>; |
| 237 | def : ProcessorModel<"penryn", SandyBridgeModel, |
| 238 | [FeatureSSE41, FeatureCMPXCHG16B, FeatureSlowBTMem]>; |
| 239 | |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 240 | // Atom CPUs. |
| 241 | class BonnellProc<string Name> : ProcessorModel<Name, AtomModel, [ |
| 242 | ProcIntelAtom, |
| 243 | FeatureSSSE3, |
| 244 | FeatureCMPXCHG16B, |
| 245 | FeatureMOVBE, |
| 246 | FeatureSlowBTMem, |
| 247 | FeatureLeaForSP, |
| 248 | FeatureSlowDivide32, |
| 249 | FeatureSlowDivide64, |
| 250 | FeatureCallRegIndirect, |
| 251 | FeatureLEAUsesAG, |
| 252 | FeaturePadShortFunctions |
| 253 | ]>; |
| 254 | def : BonnellProc<"bonnell">; |
| 255 | def : BonnellProc<"atom">; // Pin the generic name to the baseline. |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 256 | |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 257 | class SilvermontProc<string Name> : ProcessorModel<Name, SLMModel, [ |
| 258 | ProcIntelSLM, |
| 259 | FeatureSSE42, |
| 260 | FeatureCMPXCHG16B, |
| 261 | FeatureMOVBE, |
| 262 | FeaturePOPCNT, |
| 263 | FeaturePCLMUL, |
| 264 | FeatureAES, |
| 265 | FeatureSlowDivide64, |
| 266 | FeatureCallRegIndirect, |
| 267 | FeaturePRFCHW, |
| 268 | FeatureSlowLEA, |
| 269 | FeatureSlowIncDec, |
| 270 | FeatureSlowBTMem, |
| 271 | FeatureFastUAMem |
| 272 | ]>; |
| 273 | def : SilvermontProc<"silvermont">; |
| 274 | def : SilvermontProc<"slm">; // Legacy alias. |
| 275 | |
Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 276 | // "Arrandale" along with corei3 and corei5 |
Craig Topper | 3611d9b | 2015-03-30 06:31:11 +0000 | [diff] [blame] | 277 | class NehalemProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [ |
| 278 | FeatureSSE42, |
| 279 | FeatureCMPXCHG16B, |
| 280 | FeatureSlowBTMem, |
| 281 | FeatureFastUAMem, |
| 282 | FeaturePOPCNT |
| 283 | ]>; |
| 284 | def : NehalemProc<"nehalem">; |
| 285 | def : NehalemProc<"corei7">; |
Jakob Stoklund Olesen | 1ac7e66 | 2013-03-26 22:19:12 +0000 | [diff] [blame] | 286 | |
Eric Christopher | 2ef6318 | 2010-04-02 21:54:27 +0000 | [diff] [blame] | 287 | // Westmere is a similar machine to nehalem with some additional features. |
| 288 | // Westmere is the corei3/i5/i7 path from nehalem to sandybridge |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 289 | class WestmereProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [ |
| 290 | FeatureSSE42, |
| 291 | FeatureCMPXCHG16B, |
| 292 | FeatureSlowBTMem, |
| 293 | FeatureFastUAMem, |
| 294 | FeaturePOPCNT, |
| 295 | FeatureAES, |
| 296 | FeaturePCLMUL |
| 297 | ]>; |
| 298 | def : WestmereProc<"westmere">; |
| 299 | |
Nate Begeman | 8b08f52 | 2010-12-10 00:26:57 +0000 | [diff] [blame] | 300 | // SSE is not listed here since llvm treats AVX as a reimplementation of SSE, |
| 301 | // rather than a superset. |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 302 | class SandyBridgeProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [ |
| 303 | FeatureAVX, |
| 304 | FeatureCMPXCHG16B, |
| 305 | FeatureFastUAMem, |
| 306 | FeatureSlowUAMem32, |
| 307 | FeaturePOPCNT, |
| 308 | FeatureAES, |
| 309 | FeaturePCLMUL |
| 310 | ]>; |
| 311 | def : SandyBridgeProc<"sandybridge">; |
| 312 | def : SandyBridgeProc<"corei7-avx">; // Legacy alias. |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 313 | |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 314 | class IvyBridgeProc<string Name> : ProcessorModel<Name, SandyBridgeModel, [ |
| 315 | FeatureAVX, |
| 316 | FeatureCMPXCHG16B, |
| 317 | FeatureFastUAMem, |
| 318 | FeatureSlowUAMem32, |
| 319 | FeaturePOPCNT, |
| 320 | FeatureAES, |
| 321 | FeaturePCLMUL, |
| 322 | FeatureRDRAND, |
| 323 | FeatureF16C, |
| 324 | FeatureFSGSBase |
| 325 | ]>; |
| 326 | def : IvyBridgeProc<"ivybridge">; |
| 327 | def : IvyBridgeProc<"core-avx-i">; // Legacy alias. |
Craig Topper | 3657fe4 | 2011-10-14 03:21:46 +0000 | [diff] [blame] | 328 | |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 329 | class HaswellProc<string Name> : ProcessorModel<Name, HaswellModel, [ |
| 330 | FeatureAVX2, |
| 331 | FeatureCMPXCHG16B, |
| 332 | FeatureFastUAMem, |
| 333 | FeaturePOPCNT, |
| 334 | FeatureAES, |
| 335 | FeaturePCLMUL, |
| 336 | FeatureRDRAND, |
| 337 | FeatureF16C, |
| 338 | FeatureFSGSBase, |
| 339 | FeatureMOVBE, |
| 340 | FeatureLZCNT, |
| 341 | FeatureBMI, |
| 342 | FeatureBMI2, |
| 343 | FeatureFMA, |
| 344 | FeatureRTM, |
| 345 | FeatureHLE, |
| 346 | FeatureSlowIncDec |
| 347 | ]>; |
| 348 | def : HaswellProc<"haswell">; |
| 349 | def : HaswellProc<"core-avx2">; // Legacy alias. |
| 350 | |
| 351 | class BroadwellProc<string Name> : ProcessorModel<Name, HaswellModel, [ |
| 352 | FeatureAVX2, |
| 353 | FeatureCMPXCHG16B, |
| 354 | FeatureFastUAMem, |
| 355 | FeaturePOPCNT, |
| 356 | FeatureAES, |
| 357 | FeaturePCLMUL, |
| 358 | FeatureRDRAND, |
| 359 | FeatureF16C, |
| 360 | FeatureFSGSBase, |
| 361 | FeatureMOVBE, |
| 362 | FeatureLZCNT, |
| 363 | FeatureBMI, |
| 364 | FeatureBMI2, |
| 365 | FeatureFMA, |
| 366 | FeatureRTM, |
| 367 | FeatureHLE, |
| 368 | FeatureADX, |
| 369 | FeatureRDSEED, |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 370 | FeatureSlowIncDec |
| 371 | ]>; |
| 372 | def : BroadwellProc<"broadwell">; |
| 373 | |
Elena Demikhovsky | 8cfb43f | 2013-07-24 11:02:47 +0000 | [diff] [blame] | 374 | // FIXME: define KNL model |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 375 | class KnightsLandingProc<string Name> : ProcessorModel<Name, HaswellModel, |
Elena Demikhovsky | 8cfb43f | 2013-07-24 11:02:47 +0000 | [diff] [blame] | 376 | [FeatureAVX512, FeatureERI, FeatureCDI, FeaturePFI, |
| 377 | FeatureCMPXCHG16B, FeatureFastUAMem, FeaturePOPCNT, |
| 378 | FeatureAES, FeaturePCLMUL, FeatureRDRAND, FeatureF16C, |
| 379 | FeatureFSGSBase, FeatureMOVBE, FeatureLZCNT, FeatureBMI, |
Elena Demikhovsky | 678bd5b | 2014-07-02 14:11:05 +0000 | [diff] [blame] | 380 | FeatureBMI2, FeatureFMA, FeatureRTM, FeatureHLE, |
Elena Demikhovsky | f7e641c | 2015-06-03 10:30:57 +0000 | [diff] [blame] | 381 | FeatureSlowIncDec, FeatureMPX]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 382 | def : KnightsLandingProc<"knl">; |
Elena Demikhovsky | 8cfb43f | 2013-07-24 11:02:47 +0000 | [diff] [blame] | 383 | |
Robert Khasanov | bfa0131 | 2014-07-21 14:54:21 +0000 | [diff] [blame] | 384 | // FIXME: define SKX model |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 385 | class SkylakeProc<string Name> : ProcessorModel<Name, HaswellModel, |
Robert Khasanov | bfa0131 | 2014-07-21 14:54:21 +0000 | [diff] [blame] | 386 | [FeatureAVX512, FeatureCDI, |
| 387 | FeatureDQI, FeatureBWI, FeatureVLX, |
| 388 | FeatureCMPXCHG16B, FeatureFastUAMem, FeaturePOPCNT, |
| 389 | FeatureAES, FeaturePCLMUL, FeatureRDRAND, FeatureF16C, |
| 390 | FeatureFSGSBase, FeatureMOVBE, FeatureLZCNT, FeatureBMI, |
| 391 | FeatureBMI2, FeatureFMA, FeatureRTM, FeatureHLE, |
Elena Demikhovsky | f7e641c | 2015-06-03 10:30:57 +0000 | [diff] [blame] | 392 | FeatureSlowIncDec, FeatureMPX]>; |
Chandler Carruth | af892403 | 2014-12-09 10:58:36 +0000 | [diff] [blame] | 393 | def : SkylakeProc<"skylake">; |
| 394 | def : SkylakeProc<"skx">; // Legacy alias. |
| 395 | |
| 396 | |
| 397 | // AMD CPUs. |
Robert Khasanov | bfa0131 | 2014-07-21 14:54:21 +0000 | [diff] [blame] | 398 | |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 399 | def : Proc<"k6", [FeatureMMX]>; |
Michael J. Spencer | 30088ba | 2011-04-15 00:32:41 +0000 | [diff] [blame] | 400 | def : Proc<"k6-2", [Feature3DNow]>; |
| 401 | def : Proc<"k6-3", [Feature3DNow]>; |
Alexey Volkov | bb2f047 | 2014-03-07 08:28:44 +0000 | [diff] [blame] | 402 | def : Proc<"athlon", [Feature3DNowA, FeatureSlowBTMem, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 403 | FeatureSlowSHLD]>; |
| 404 | def : Proc<"athlon-tbird", [Feature3DNowA, FeatureSlowBTMem, |
| 405 | FeatureSlowSHLD]>; |
Michael Liao | 5bf9578 | 2014-12-04 05:20:33 +0000 | [diff] [blame] | 406 | def : Proc<"athlon-4", [FeatureSSE1, Feature3DNowA, FeatureSlowBTMem, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 407 | FeatureSlowSHLD]>; |
| 408 | def : Proc<"athlon-xp", [FeatureSSE1, Feature3DNowA, FeatureSlowBTMem, |
| 409 | FeatureSlowSHLD]>; |
| 410 | def : Proc<"athlon-mp", [FeatureSSE1, Feature3DNowA, FeatureSlowBTMem, |
| 411 | FeatureSlowSHLD]>; |
Dan Gohman | 7403751 | 2009-02-03 00:04:43 +0000 | [diff] [blame] | 412 | def : Proc<"k8", [FeatureSSE2, Feature3DNowA, Feature64Bit, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 413 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
Dan Gohman | 7403751 | 2009-02-03 00:04:43 +0000 | [diff] [blame] | 414 | def : Proc<"opteron", [FeatureSSE2, Feature3DNowA, Feature64Bit, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 415 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
Dan Gohman | 7403751 | 2009-02-03 00:04:43 +0000 | [diff] [blame] | 416 | def : Proc<"athlon64", [FeatureSSE2, Feature3DNowA, Feature64Bit, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 417 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
Dan Gohman | 7403751 | 2009-02-03 00:04:43 +0000 | [diff] [blame] | 418 | def : Proc<"athlon-fx", [FeatureSSE2, Feature3DNowA, Feature64Bit, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 419 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
Eli Friedman | 5e57042 | 2011-08-26 21:21:21 +0000 | [diff] [blame] | 420 | def : Proc<"k8-sse3", [FeatureSSE3, Feature3DNowA, FeatureCMPXCHG16B, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 421 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
Eli Friedman | 5e57042 | 2011-08-26 21:21:21 +0000 | [diff] [blame] | 422 | def : Proc<"opteron-sse3", [FeatureSSE3, Feature3DNowA, FeatureCMPXCHG16B, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 423 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
Eli Friedman | 5e57042 | 2011-08-26 21:21:21 +0000 | [diff] [blame] | 424 | def : Proc<"athlon64-sse3", [FeatureSSE3, Feature3DNowA, FeatureCMPXCHG16B, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 425 | FeatureSlowBTMem, FeatureSlowSHLD]>; |
Craig Topper | bae0e9e | 2012-05-01 06:54:48 +0000 | [diff] [blame] | 426 | def : Proc<"amdfam10", [FeatureSSE4A, |
Benjamin Kramer | 5feb3da | 2011-11-30 15:48:16 +0000 | [diff] [blame] | 427 | Feature3DNowA, FeatureCMPXCHG16B, FeatureLZCNT, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 428 | FeaturePOPCNT, FeatureSlowBTMem, |
| 429 | FeatureSlowSHLD]>; |
Chandler Carruth | f57ac3b | 2014-12-09 14:25:55 +0000 | [diff] [blame] | 430 | def : Proc<"barcelona", [FeatureSSE4A, |
| 431 | Feature3DNowA, FeatureCMPXCHG16B, FeatureLZCNT, |
| 432 | FeaturePOPCNT, FeatureSlowBTMem, |
| 433 | FeatureSlowSHLD]>; |
Benjamin Kramer | 077ae1d | 2012-01-10 11:50:02 +0000 | [diff] [blame] | 434 | // Bobcat |
| 435 | def : Proc<"btver1", [FeatureSSSE3, FeatureSSE4A, FeatureCMPXCHG16B, |
Ekaterina Romanova | d5fa554 | 2013-11-21 23:21:26 +0000 | [diff] [blame] | 436 | FeaturePRFCHW, FeatureLZCNT, FeaturePOPCNT, |
| 437 | FeatureSlowSHLD]>; |
Sanjay Patel | 1191adf | 2014-09-09 20:07:07 +0000 | [diff] [blame] | 438 | |
Benjamin Kramer | b44c427 | 2013-05-03 10:20:08 +0000 | [diff] [blame] | 439 | // Jaguar |
Sanjay Patel | 1191adf | 2014-09-09 20:07:07 +0000 | [diff] [blame] | 440 | def : ProcessorModel<"btver2", BtVer2Model, |
| 441 | [FeatureAVX, FeatureSSE4A, FeatureCMPXCHG16B, |
| 442 | FeaturePRFCHW, FeatureAES, FeaturePCLMUL, |
| 443 | FeatureBMI, FeatureF16C, FeatureMOVBE, |
Sanjay Patel | e57f3c0 | 2014-11-28 18:40:18 +0000 | [diff] [blame] | 444 | FeatureLZCNT, FeaturePOPCNT, FeatureFastUAMem, |
Sanjay Patel | 667a7e2 | 2015-06-04 01:32:35 +0000 | [diff] [blame^] | 445 | FeatureSlowSHLD]>; |
Sanjay Patel | e57f3c0 | 2014-11-28 18:40:18 +0000 | [diff] [blame] | 446 | |
| 447 | // TODO: We should probably add 'FeatureFastUAMem' to all of the AMD chips. |
Sanjay Patel | 1191adf | 2014-09-09 20:07:07 +0000 | [diff] [blame] | 448 | |
Benjamin Kramer | 077ae1d | 2012-01-10 11:50:02 +0000 | [diff] [blame] | 449 | // Bulldozer |
Craig Topper | bae0e9e | 2012-05-01 06:54:48 +0000 | [diff] [blame] | 450 | def : Proc<"bdver1", [FeatureXOP, FeatureFMA4, FeatureCMPXCHG16B, |
Yunzhong Gao | dfc277f | 2013-10-16 19:04:11 +0000 | [diff] [blame] | 451 | FeatureAES, FeaturePRFCHW, FeaturePCLMUL, |
Andrea Di Biagio | f5b34e5 | 2014-11-04 21:18:09 +0000 | [diff] [blame] | 452 | FeatureAVX, FeatureSSE4A, FeatureLZCNT, |
| 453 | FeaturePOPCNT, FeatureSlowSHLD]>; |
Benjamin Kramer | b44c427 | 2013-05-03 10:20:08 +0000 | [diff] [blame] | 454 | // Piledriver |
Craig Topper | bae0e9e | 2012-05-01 06:54:48 +0000 | [diff] [blame] | 455 | def : Proc<"bdver2", [FeatureXOP, FeatureFMA4, FeatureCMPXCHG16B, |
Yunzhong Gao | dfc277f | 2013-10-16 19:04:11 +0000 | [diff] [blame] | 456 | FeatureAES, FeaturePRFCHW, FeaturePCLMUL, |
Andrea Di Biagio | f5b34e5 | 2014-11-04 21:18:09 +0000 | [diff] [blame] | 457 | FeatureAVX, FeatureSSE4A, FeatureF16C, |
| 458 | FeatureLZCNT, FeaturePOPCNT, FeatureBMI, |
| 459 | FeatureTBM, FeatureFMA, FeatureSlowSHLD]>; |
Benjamin Kramer | d114def | 2013-11-04 10:29:20 +0000 | [diff] [blame] | 460 | |
| 461 | // Steamroller |
| 462 | def : Proc<"bdver3", [FeatureXOP, FeatureFMA4, FeatureCMPXCHG16B, |
| 463 | FeatureAES, FeaturePRFCHW, FeaturePCLMUL, |
Andrea Di Biagio | f5b34e5 | 2014-11-04 21:18:09 +0000 | [diff] [blame] | 464 | FeatureAVX, FeatureSSE4A, FeatureF16C, |
| 465 | FeatureLZCNT, FeaturePOPCNT, FeatureBMI, |
| 466 | FeatureTBM, FeatureFMA, FeatureSlowSHLD, |
| 467 | FeatureFSGSBase]>; |
Benjamin Kramer | d114def | 2013-11-04 10:29:20 +0000 | [diff] [blame] | 468 | |
Benjamin Kramer | 6004573 | 2014-05-02 15:47:07 +0000 | [diff] [blame] | 469 | // Excavator |
| 470 | def : Proc<"bdver4", [FeatureAVX2, FeatureXOP, FeatureFMA4, |
| 471 | FeatureCMPXCHG16B, FeatureAES, FeaturePRFCHW, |
| 472 | FeaturePCLMUL, FeatureF16C, FeatureLZCNT, |
| 473 | FeaturePOPCNT, FeatureBMI, FeatureBMI2, |
Andrea Di Biagio | f5b34e5 | 2014-11-04 21:18:09 +0000 | [diff] [blame] | 474 | FeatureTBM, FeatureFMA, FeatureSSE4A, |
| 475 | FeatureFSGSBase]>; |
Benjamin Kramer | 6004573 | 2014-05-02 15:47:07 +0000 | [diff] [blame] | 476 | |
Roman Divacky | fd69009 | 2012-09-12 14:36:02 +0000 | [diff] [blame] | 477 | def : Proc<"geode", [Feature3DNowA]>; |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 478 | |
| 479 | def : Proc<"winchip-c6", [FeatureMMX]>; |
Michael J. Spencer | 30088ba | 2011-04-15 00:32:41 +0000 | [diff] [blame] | 480 | def : Proc<"winchip2", [Feature3DNow]>; |
| 481 | def : Proc<"c3", [Feature3DNow]>; |
Bill Wendling | 3fb7fdf | 2007-05-22 05:15:37 +0000 | [diff] [blame] | 482 | def : Proc<"c3-2", [FeatureSSE1]>; |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 483 | |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 484 | // We also provide a generic 64-bit specific x86 processor model which tries to |
| 485 | // be good for modern chips without enabling instruction set encodings past the |
| 486 | // basic SSE2 and 64-bit ones. It disables slow things from any mainstream and |
| 487 | // modern 64-bit x86 chip, and enables features that are generally beneficial. |
Michael Liao | 5bf9578 | 2014-12-04 05:20:33 +0000 | [diff] [blame] | 488 | // |
Chandler Carruth | 32908d7 | 2014-05-07 17:37:03 +0000 | [diff] [blame] | 489 | // We currently use the Sandy Bridge model as the default scheduling model as |
| 490 | // we use it across Nehalem, Westmere, Sandy Bridge, and Ivy Bridge which |
| 491 | // covers a huge swath of x86 processors. If there are specific scheduling |
| 492 | // knobs which need to be tuned differently for AMD chips, we might consider |
| 493 | // forming a common base for them. |
| 494 | def : ProcessorModel<"x86-64", SandyBridgeModel, |
| 495 | [FeatureSSE2, Feature64Bit, FeatureSlowBTMem, |
| 496 | FeatureFastUAMem]>; |
| 497 | |
Evan Cheng | ff1beda | 2006-10-06 09:17:41 +0000 | [diff] [blame] | 498 | //===----------------------------------------------------------------------===// |
Chris Lattner | 5da8e80 | 2003-08-03 15:47:49 +0000 | [diff] [blame] | 499 | // Register File Description |
| 500 | //===----------------------------------------------------------------------===// |
| 501 | |
| 502 | include "X86RegisterInfo.td" |
| 503 | |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 504 | //===----------------------------------------------------------------------===// |
| 505 | // Instruction Descriptions |
| 506 | //===----------------------------------------------------------------------===// |
| 507 | |
Chris Lattner | 59a4a91 | 2003-08-03 21:54:21 +0000 | [diff] [blame] | 508 | include "X86InstrInfo.td" |
| 509 | |
Jakob Stoklund Olesen | b93331f | 2010-04-05 03:10:20 +0000 | [diff] [blame] | 510 | def X86InstrInfo : InstrInfo; |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 511 | |
Chris Lattner | 5d00a0b | 2007-02-26 18:17:14 +0000 | [diff] [blame] | 512 | //===----------------------------------------------------------------------===// |
| 513 | // Calling Conventions |
| 514 | //===----------------------------------------------------------------------===// |
| 515 | |
| 516 | include "X86CallingConv.td" |
| 517 | |
| 518 | |
| 519 | //===----------------------------------------------------------------------===// |
Jim Grosbach | 4cf25f5 | 2010-10-30 13:48:28 +0000 | [diff] [blame] | 520 | // Assembly Parser |
Chris Lattner | 5d00a0b | 2007-02-26 18:17:14 +0000 | [diff] [blame] | 521 | //===----------------------------------------------------------------------===// |
| 522 | |
Daniel Dunbar | 0033199 | 2009-07-29 00:02:19 +0000 | [diff] [blame] | 523 | def ATTAsmParser : AsmParser { |
Devang Patel | 4a6e778 | 2012-01-12 18:03:40 +0000 | [diff] [blame] | 524 | string AsmParserClassName = "AsmParser"; |
Devang Patel | 85d684a | 2012-01-09 19:13:28 +0000 | [diff] [blame] | 525 | } |
| 526 | |
| 527 | def ATTAsmParserVariant : AsmParserVariant { |
Daniel Dunbar | 0033199 | 2009-07-29 00:02:19 +0000 | [diff] [blame] | 528 | int Variant = 0; |
Daniel Dunbar | e431871 | 2009-08-11 20:59:47 +0000 | [diff] [blame] | 529 | |
Chad Rosier | 9f7a221 | 2013-04-18 22:35:36 +0000 | [diff] [blame] | 530 | // Variant name. |
| 531 | string Name = "att"; |
| 532 | |
Daniel Dunbar | e431871 | 2009-08-11 20:59:47 +0000 | [diff] [blame] | 533 | // Discard comments in assembly strings. |
| 534 | string CommentDelimiter = "#"; |
| 535 | |
| 536 | // Recognize hard coded registers. |
| 537 | string RegisterPrefix = "%"; |
Daniel Dunbar | 0033199 | 2009-07-29 00:02:19 +0000 | [diff] [blame] | 538 | } |
| 539 | |
Devang Patel | 67bf992a | 2012-01-10 17:51:54 +0000 | [diff] [blame] | 540 | def IntelAsmParserVariant : AsmParserVariant { |
| 541 | int Variant = 1; |
| 542 | |
Chad Rosier | 9f7a221 | 2013-04-18 22:35:36 +0000 | [diff] [blame] | 543 | // Variant name. |
| 544 | string Name = "intel"; |
| 545 | |
Devang Patel | 67bf992a | 2012-01-10 17:51:54 +0000 | [diff] [blame] | 546 | // Discard comments in assembly strings. |
| 547 | string CommentDelimiter = ";"; |
| 548 | |
| 549 | // Recognize hard coded registers. |
| 550 | string RegisterPrefix = ""; |
| 551 | } |
| 552 | |
Jim Grosbach | 4cf25f5 | 2010-10-30 13:48:28 +0000 | [diff] [blame] | 553 | //===----------------------------------------------------------------------===// |
| 554 | // Assembly Printers |
| 555 | //===----------------------------------------------------------------------===// |
| 556 | |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 557 | // The X86 target supports two different syntaxes for emitting machine code. |
| 558 | // This is controlled by the -x86-asm-syntax={att|intel} |
| 559 | def ATTAsmWriter : AsmWriter { |
Chris Lattner | 1cbd3de | 2009-09-13 19:30:11 +0000 | [diff] [blame] | 560 | string AsmWriterClassName = "ATTInstPrinter"; |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 561 | int Variant = 0; |
| 562 | } |
| 563 | def IntelAsmWriter : AsmWriter { |
Chris Lattner | 13306a1 | 2009-09-20 07:47:59 +0000 | [diff] [blame] | 564 | string AsmWriterClassName = "IntelInstPrinter"; |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 565 | int Variant = 1; |
| 566 | } |
| 567 | |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 568 | def X86 : Target { |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 569 | // Information about the instructions... |
Chris Lattner | 2551080 | 2003-08-04 04:59:56 +0000 | [diff] [blame] | 570 | let InstructionSet = X86InstrInfo; |
Daniel Dunbar | 0033199 | 2009-07-29 00:02:19 +0000 | [diff] [blame] | 571 | let AssemblyParsers = [ATTAsmParser]; |
Devang Patel | 67bf992a | 2012-01-10 17:51:54 +0000 | [diff] [blame] | 572 | let AssemblyParserVariants = [ATTAsmParserVariant, IntelAsmParserVariant]; |
Chris Lattner | 5683260 | 2004-10-03 20:36:57 +0000 | [diff] [blame] | 573 | let AssemblyWriters = [ATTAsmWriter, IntelAsmWriter]; |
Chris Lattner | a8c3cff | 2003-08-03 18:19:37 +0000 | [diff] [blame] | 574 | } |