1235633Sdim//===-- Sparc.td - Describe the Sparc Target Machine -------*- tablegen -*-===//
2235633Sdim//
3193323Sed//                     The LLVM Compiler Infrastructure
4193323Sed//
5193323Sed// This file is distributed under the University of Illinois Open Source
6193323Sed// License. See LICENSE.TXT for details.
7235633Sdim//
8193323Sed//===----------------------------------------------------------------------===//
9193323Sed//
10193323Sed//
11193323Sed//===----------------------------------------------------------------------===//
12193323Sed
13193323Sed//===----------------------------------------------------------------------===//
14193323Sed// Target-independent interfaces which we are implementing
15193323Sed//===----------------------------------------------------------------------===//
16193323Sed
17193323Sedinclude "llvm/Target/Target.td"
18193323Sed
19193323Sed//===----------------------------------------------------------------------===//
20193323Sed// SPARC Subtarget features.
21193323Sed//
22263509Sdim
23193323Seddef FeatureV9
24193323Sed  : SubtargetFeature<"v9", "IsV9", "true",
25193323Sed                     "Enable SPARC-V9 instructions">;
26193323Seddef FeatureV8Deprecated
27193323Sed  : SubtargetFeature<"deprecated-v8", "V8DeprecatedInsts", "true",
28193323Sed                     "Enable deprecated V8 instructions in V9 mode">;
29193323Seddef FeatureVIS
30193323Sed  : SubtargetFeature<"vis", "IsVIS", "true",
31193323Sed                     "Enable UltraSPARC Visual Instruction Set extensions">;
32193323Sed
33263509Sdimdef FeatureHardQuad
34263509Sdim  : SubtargetFeature<"hard-quad-float", "HasHardQuad", "true",
35263509Sdim                     "Enable quad-word floating point instructions">;
36263509Sdim
37263764Sdimdef UsePopc : SubtargetFeature<"popc", "UsePopc", "true",
38263764Sdim                               "Use the popc (population count) instruction">;
39263764Sdim
40193323Sed//===----------------------------------------------------------------------===//
41193323Sed// Register File, Calling Conv, Instruction Descriptions
42193323Sed//===----------------------------------------------------------------------===//
43193323Sed
44193323Sedinclude "SparcRegisterInfo.td"
45193323Sedinclude "SparcCallingConv.td"
46193323Sedinclude "SparcInstrInfo.td"
47193323Sed
48206274Srdivackydef SparcInstrInfo : InstrInfo;
49193323Sed
50263764Sdimdef SparcAsmParser : AsmParser {
51263764Sdim  bit ShouldEmitMatchRegisterName = 0;
52263764Sdim}
53263764Sdim
54193323Sed//===----------------------------------------------------------------------===//
55193323Sed// SPARC processors supported.
56193323Sed//===----------------------------------------------------------------------===//
57193323Sed
58193323Sedclass Proc<string Name, list<SubtargetFeature> Features>
59193323Sed : Processor<Name, NoItineraries, Features>;
60193323Sed
61193323Seddef : Proc<"generic",         []>;
62263764Sdimdef : Proc<"v7",              []>;
63193323Seddef : Proc<"v8",              []>;
64193323Seddef : Proc<"supersparc",      []>;
65193323Seddef : Proc<"sparclite",       []>;
66193323Seddef : Proc<"f934",            []>;
67193323Seddef : Proc<"hypersparc",      []>;
68193323Seddef : Proc<"sparclite86x",    []>;
69193323Seddef : Proc<"sparclet",        []>;
70193323Seddef : Proc<"tsc701",          []>;
71193323Seddef : Proc<"v9",              [FeatureV9]>;
72193323Seddef : Proc<"ultrasparc",      [FeatureV9, FeatureV8Deprecated]>;
73193323Seddef : Proc<"ultrasparc3",     [FeatureV9, FeatureV8Deprecated]>;
74263764Sdimdef : Proc<"niagara",         [FeatureV9, FeatureV8Deprecated]>;
75263764Sdimdef : Proc<"niagara2",        [FeatureV9, FeatureV8Deprecated, UsePopc]>;
76263764Sdimdef : Proc<"niagara3",        [FeatureV9, FeatureV8Deprecated, UsePopc]>;
77263764Sdimdef : Proc<"niagara4",        [FeatureV9, FeatureV8Deprecated, UsePopc]>;
78193323Sed
79263764Sdimdef SparcAsmWriter : AsmWriter {
80263764Sdim  string AsmWriterClassName  = "InstPrinter";
81263764Sdim  bit isMCAsmWriter = 1;
82263764Sdim}
83193323Sed
84193323Sed//===----------------------------------------------------------------------===//
85193323Sed// Declare the target which we are implementing
86193323Sed//===----------------------------------------------------------------------===//
87193323Sed
88193323Seddef Sparc : Target {
89193323Sed  // Pull in Instruction Info:
90193323Sed  let InstructionSet = SparcInstrInfo;
91263764Sdim  let AssemblyParsers  = [SparcAsmParser];
92263764Sdim
93263764Sdim  let AssemblyWriters = [SparcAsmWriter];
94193323Sed}
95