Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 1 | //===-- Sparc.td - Describe the Sparc Target Machine -------*- tablegen -*-===// |
| 2 | // |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +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. |
Jia Liu | b22310f | 2012-02-18 12:03:15 +0000 | [diff] [blame] | 7 | // |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 8 | //===----------------------------------------------------------------------===// |
| 9 | // |
| 10 | // |
| 11 | //===----------------------------------------------------------------------===// |
| 12 | |
| 13 | //===----------------------------------------------------------------------===// |
| 14 | // Target-independent interfaces which we are implementing |
| 15 | //===----------------------------------------------------------------------===// |
| 16 | |
Evan Cheng | 977e7be | 2008-11-24 07:34:46 +0000 | [diff] [blame] | 17 | include "llvm/Target/Target.td" |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 18 | |
| 19 | //===----------------------------------------------------------------------===// |
| 20 | // SPARC Subtarget features. |
| 21 | // |
Venkatraman Govindaraju | a54533ed | 2013-06-04 18:33:25 +0000 | [diff] [blame] | 22 | |
James Y Knight | dda87ca | 2017-07-18 19:08:38 +0000 | [diff] [blame^] | 23 | def FeatureSoftMulDiv |
| 24 | : SubtargetFeature<"soft-mul-div", "UseSoftMulDiv", "true", |
| 25 | "Use software emulation for integer multiply and divide">; |
| 26 | |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 27 | def FeatureV9 |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 28 | : SubtargetFeature<"v9", "IsV9", "true", |
| 29 | "Enable SPARC-V9 instructions">; |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 30 | def FeatureV8Deprecated |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 31 | : SubtargetFeature<"deprecated-v8", "V8DeprecatedInsts", "true", |
| 32 | "Enable deprecated V8 instructions in V9 mode">; |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 33 | def FeatureVIS |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 34 | : SubtargetFeature<"vis", "IsVIS", "true", |
| 35 | "Enable UltraSPARC Visual Instruction Set extensions">; |
Venkatraman Govindaraju | f9a202a | 2014-03-02 19:31:21 +0000 | [diff] [blame] | 36 | def FeatureVIS2 |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 37 | : SubtargetFeature<"vis2", "IsVIS2", "true", |
| 38 | "Enable Visual Instruction Set extensions II">; |
Venkatraman Govindaraju | f9a202a | 2014-03-02 19:31:21 +0000 | [diff] [blame] | 39 | def FeatureVIS3 |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 40 | : SubtargetFeature<"vis3", "IsVIS3", "true", |
| 41 | "Enable Visual Instruction Set extensions III">; |
Chris Dewhurst | 6019702 | 2016-04-22 08:17:17 +0000 | [diff] [blame] | 42 | def FeatureLeon |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 43 | : SubtargetFeature<"leon", "IsLeon", "true", |
| 44 | "Enable LEON extensions">; |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 45 | |
Venkatraman Govindaraju | 35e0c38 | 2013-08-25 18:30:06 +0000 | [diff] [blame] | 46 | def FeatureHardQuad |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 47 | : SubtargetFeature<"hard-quad-float", "HasHardQuad", "true", |
| 48 | "Enable quad-word floating point instructions">; |
Venkatraman Govindaraju | 35e0c38 | 2013-08-25 18:30:06 +0000 | [diff] [blame] | 49 | |
Jakob Stoklund Olesen | ead3b3d | 2014-01-26 06:09:59 +0000 | [diff] [blame] | 50 | def UsePopc : SubtargetFeature<"popc", "UsePopc", "true", |
| 51 | "Use the popc (population count) instruction">; |
| 52 | |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 53 | def FeatureSoftFloat : SubtargetFeature<"soft-float", "UseSoftFloat", "true", |
| 54 | "Use software emulation for floating point">; |
Chris Dewhurst | 68388a0 | 2016-05-18 09:14:13 +0000 | [diff] [blame] | 55 | |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 56 | //==== Features added predmoninantly for LEON subtarget support |
Chris Dewhurst | e3b8645 | 2016-05-09 11:55:15 +0000 | [diff] [blame] | 57 | include "LeonFeatures.td" |
| 58 | |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 59 | //===----------------------------------------------------------------------===// |
Chris Lattner | 49b269d | 2008-03-17 05:41:48 +0000 | [diff] [blame] | 60 | // Register File, Calling Conv, Instruction Descriptions |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 61 | //===----------------------------------------------------------------------===// |
| 62 | |
| 63 | include "SparcRegisterInfo.td" |
Chris Lattner | 49b269d | 2008-03-17 05:41:48 +0000 | [diff] [blame] | 64 | include "SparcCallingConv.td" |
Chris Dewhurst | 6019702 | 2016-04-22 08:17:17 +0000 | [diff] [blame] | 65 | include "SparcSchedule.td" |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 66 | include "SparcInstrInfo.td" |
| 67 | |
Jakob Stoklund Olesen | b93331f | 2010-04-05 03:10:20 +0000 | [diff] [blame] | 68 | def SparcInstrInfo : InstrInfo; |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 69 | |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 70 | def SparcAsmParser : AsmParser { |
| 71 | bit ShouldEmitMatchRegisterName = 0; |
| 72 | } |
Venkatraman Govindaraju | c2dee7d | 2014-01-04 11:30:13 +0000 | [diff] [blame] | 73 | |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 74 | //===----------------------------------------------------------------------===// |
| 75 | // SPARC processors supported. |
| 76 | //===----------------------------------------------------------------------===// |
| 77 | |
| 78 | class Proc<string Name, list<SubtargetFeature> Features> |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 79 | : Processor<Name, NoItineraries, Features>; |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 80 | |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 81 | def : Proc<"generic", []>; |
James Y Knight | dda87ca | 2017-07-18 19:08:38 +0000 | [diff] [blame^] | 82 | def : Proc<"v7", [FeatureSoftMulDiv]>; |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 83 | def : Proc<"v8", []>; |
| 84 | def : Proc<"supersparc", []>; |
| 85 | def : Proc<"sparclite", []>; |
| 86 | def : Proc<"f934", []>; |
| 87 | def : Proc<"hypersparc", []>; |
| 88 | def : Proc<"sparclite86x", []>; |
| 89 | def : Proc<"sparclet", []>; |
| 90 | def : Proc<"tsc701", []>; |
Douglas Katzman | 8ea02f4 | 2016-09-13 17:51:41 +0000 | [diff] [blame] | 91 | def : Proc<"myriad2", [FeatureLeon, LeonCASA]>; |
| 92 | def : Proc<"myriad2.1", [FeatureLeon, LeonCASA]>; |
| 93 | def : Proc<"myriad2.2", [FeatureLeon, LeonCASA]>; |
| 94 | def : Proc<"ma2100", [FeatureLeon, LeonCASA]>; |
| 95 | def : Proc<"ma2150", [FeatureLeon, LeonCASA]>; |
| 96 | def : Proc<"ma2450", [FeatureLeon, LeonCASA]>; |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 97 | def : Proc<"v9", [FeatureV9]>; |
| 98 | def : Proc<"ultrasparc", [FeatureV9, FeatureV8Deprecated, FeatureVIS]>; |
| 99 | def : Proc<"ultrasparc3", [FeatureV9, FeatureV8Deprecated, FeatureVIS, |
| 100 | FeatureVIS2]>; |
| 101 | def : Proc<"niagara", [FeatureV9, FeatureV8Deprecated, FeatureVIS, |
| 102 | FeatureVIS2]>; |
| 103 | def : Proc<"niagara2", [FeatureV9, FeatureV8Deprecated, UsePopc, |
| 104 | FeatureVIS, FeatureVIS2]>; |
| 105 | def : Proc<"niagara3", [FeatureV9, FeatureV8Deprecated, UsePopc, |
| 106 | FeatureVIS, FeatureVIS2]>; |
| 107 | def : Proc<"niagara4", [FeatureV9, FeatureV8Deprecated, UsePopc, |
| 108 | FeatureVIS, FeatureVIS2, FeatureVIS3]>; |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 109 | |
Chris Dewhurst | 6019702 | 2016-04-22 08:17:17 +0000 | [diff] [blame] | 110 | // LEON 2 FT generic |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 111 | def : Processor<"leon2", LEON2Itineraries, |
| 112 | [FeatureLeon]>; |
Chris Dewhurst | 6019702 | 2016-04-22 08:17:17 +0000 | [diff] [blame] | 113 | |
| 114 | // LEON 2 FT (AT697E) |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 115 | // TO DO: Place-holder: Processor specific features will be added *very* soon here. |
| 116 | def : Processor<"at697e", LEON2Itineraries, |
Chris Dewhurst | 8501312 | 2016-10-10 08:53:06 +0000 | [diff] [blame] | 117 | [FeatureLeon, ReplaceSDIV, InsertNOPLoad]>; |
Chris Dewhurst | 6019702 | 2016-04-22 08:17:17 +0000 | [diff] [blame] | 118 | |
| 119 | // LEON 2 FT (AT697F) |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 120 | // TO DO: Place-holder: Processor specific features will be added *very* soon here. |
Chris Dewhurst | 6019702 | 2016-04-22 08:17:17 +0000 | [diff] [blame] | 121 | def : Processor<"at697f", LEON2Itineraries, |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 122 | [FeatureLeon, InsertNOPLoad]>; |
| 123 | |
Chris Dewhurst | 6019702 | 2016-04-22 08:17:17 +0000 | [diff] [blame] | 124 | |
| 125 | // LEON 3 FT generic |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 126 | def : Processor<"leon3", LEON3Itineraries, |
| 127 | [FeatureLeon, UMACSMACSupport]>; |
Chris Dewhurst | 6019702 | 2016-04-22 08:17:17 +0000 | [diff] [blame] | 128 | |
Chris Dewhurst | 7d8412f | 2016-05-16 11:02:00 +0000 | [diff] [blame] | 129 | // LEON 3 FT (UT699). Provides features for the UT699 processor |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 130 | // - covers all the erratum fixes for LEON3, but does not support the CASA instruction. |
| 131 | def : Processor<"ut699", LEON3Itineraries, |
| 132 | [FeatureLeon, InsertNOPLoad, FixFSMULD, ReplaceFMULS, FixAllFDIVSQRT]>; |
Chris Dewhurst | 6019702 | 2016-04-22 08:17:17 +0000 | [diff] [blame] | 133 | |
Chris Dewhurst | 7d8412f | 2016-05-16 11:02:00 +0000 | [diff] [blame] | 134 | // LEON3 FT (GR712RC). Provides features for the GR712RC processor. |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 135 | // - covers all the erratum fixed for LEON3 and support for the CASA instruction. |
Chris Dewhurst | 6019702 | 2016-04-22 08:17:17 +0000 | [diff] [blame] | 136 | def : Processor<"gr712rc", LEON3Itineraries, |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 137 | [FeatureLeon, LeonCASA]>; |
Chris Dewhurst | 6019702 | 2016-04-22 08:17:17 +0000 | [diff] [blame] | 138 | |
| 139 | // LEON 4 FT generic |
| 140 | def : Processor<"leon4", LEON4Itineraries, |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 141 | [FeatureLeon, UMACSMACSupport, LeonCASA]>; |
Chris Dewhurst | 6019702 | 2016-04-22 08:17:17 +0000 | [diff] [blame] | 142 | |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 143 | // LEON 4 FT (GR740) |
| 144 | // TO DO: Place-holder: Processor specific features will be added *very* soon here. |
| 145 | def : Processor<"gr740", LEON4Itineraries, |
| 146 | [FeatureLeon, UMACSMACSupport, LeonCASA]>; |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 147 | |
| 148 | //===----------------------------------------------------------------------===// |
| 149 | // Declare the target which we are implementing |
| 150 | //===----------------------------------------------------------------------===// |
| 151 | |
Akira Hatanaka | 725657b | 2015-03-28 04:03:51 +0000 | [diff] [blame] | 152 | def SparcAsmWriter : AsmWriter { |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 153 | string AsmWriterClassName = "InstPrinter"; |
Akira Hatanaka | 725657b | 2015-03-28 04:03:51 +0000 | [diff] [blame] | 154 | int PassSubtarget = 1; |
| 155 | int Variant = 0; |
| 156 | } |
| 157 | |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 158 | def Sparc : Target { |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 159 | // Pull in Instruction Info: |
| 160 | let InstructionSet = SparcInstrInfo; |
James Y Knight | 2cc9da9 | 2016-08-12 14:48:09 +0000 | [diff] [blame] | 161 | let AssemblyParsers = [SparcAsmParser]; |
| 162 | let AssemblyWriters = [SparcAsmWriter]; |
Chris Lattner | 158e1f5 | 2006-02-05 05:50:24 +0000 | [diff] [blame] | 163 | } |