• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//===- Blackfin.td - Describe the Blackfin Target Machine --*- tablegen -*-===//
2//
3//                     The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//
9//
10//
11//===----------------------------------------------------------------------===//
12
13//===----------------------------------------------------------------------===//
14// Target-independent interfaces which we are implementing
15//===----------------------------------------------------------------------===//
16
17include "llvm/Target/Target.td"
18
19//===----------------------------------------------------------------------===//
20// Blackfin Subtarget features.
21//===----------------------------------------------------------------------===//
22
23def FeatureSDRAM : SubtargetFeature<"sdram", "sdram", "true",
24    "Build for SDRAM">;
25
26def FeatureICPLB : SubtargetFeature<"icplb", "icplb", "true",
27    "Assume instruction cache lookaside buffers are enabled at runtime">;
28
29//===----------------------------------------------------------------------===//
30// Bugs in the silicon becomes workarounds in the compiler.
31// See http://www.analog.com/ for the full list of IC anomalies.
32//===----------------------------------------------------------------------===//
33
34def WA_MI_SHIFT : SubtargetFeature<"mi-shift-anomaly","wa_mi_shift", "true",
35    "Work around 05000074 - "
36    "Multi-Issue Instruction with dsp32shiftimm and P-reg Store">;
37
38def WA_CSYNC : SubtargetFeature<"csync-anomaly","wa_csync", "true",
39    "Work around 05000244 - "
40    "If I-Cache Is On, CSYNC/SSYNC/IDLE Around Change of Control">;
41
42def WA_SPECLD : SubtargetFeature<"specld-anomaly","wa_specld", "true",
43    "Work around 05000245 - "
44    "Access in the Shadow of a Conditional Branch">;
45
46def WA_HWLOOP : SubtargetFeature<"hwloop-anomaly","wa_hwloop", "true",
47    "Work around 05000257 - "
48    "Interrupt/Exception During Short Hardware Loop">;
49
50def WA_MMR_STALL : SubtargetFeature<"mmr-stall-anomaly","wa_mmr_stall", "true",
51    "Work around 05000283 - "
52    "System MMR Write Is Stalled Indefinitely when Killed">;
53
54def WA_LCREGS : SubtargetFeature<"lcregs-anomaly","wa_lcregs", "true",
55    "Work around 05000312 - "
56    "SSYNC, CSYNC, or Loads to LT, LB and LC Registers Are Interrupted">;
57
58def WA_KILLED_MMR : SubtargetFeature<"killed-mmr-anomaly",
59                                     "wa_killed_mmr", "true",
60    "Work around 05000315 - "
61    "Killed System MMR Write Completes Erroneously on Next System MMR Access">;
62
63def WA_RETS : SubtargetFeature<"rets-anomaly", "wa_rets", "true",
64    "Work around 05000371 - "
65    "Possible RETS Register Corruption when Subroutine Is under 5 Cycles">;
66
67def WA_IND_CALL : SubtargetFeature<"ind-call-anomaly", "wa_ind_call", "true",
68    "Work around 05000426 - "
69    "Speculative Fetches of Indirect-Pointer Instructions">;
70
71//===----------------------------------------------------------------------===//
72// Register File, Calling Conv, Instruction Descriptions
73//===----------------------------------------------------------------------===//
74
75include "BlackfinRegisterInfo.td"
76include "BlackfinCallingConv.td"
77include "BlackfinIntrinsics.td"
78include "BlackfinInstrInfo.td"
79
80def BlackfinInstrInfo : InstrInfo {}
81
82//===----------------------------------------------------------------------===//
83// Blackfin processors supported.
84//===----------------------------------------------------------------------===//
85
86class Proc<string Name, string Suffix, list<SubtargetFeature> Features>
87 : Processor<!strconcat(Name, Suffix), NoItineraries, Features>;
88
89def : Proc<"generic", "", []>;
90
91multiclass Core<string Name,string Suffix,
92                list<SubtargetFeature> Features> {
93  def : Proc<Name, Suffix, Features>;
94  def : Proc<Name, "", Features>;
95  def : Proc<Name, "-none", []>;
96}
97
98multiclass CoreEdinburgh<string Name>
99      : Core<Name, "-0.6", [WA_MI_SHIFT, WA_SPECLD, WA_LCREGS]> {
100  def : Proc<Name, "-0.5",
101        [WA_MI_SHIFT, WA_SPECLD, WA_MMR_STALL, WA_LCREGS, WA_KILLED_MMR,
102         WA_RETS]>;
103  def : Proc<Name, "-0.4",
104        [WA_MI_SHIFT, WA_CSYNC, WA_SPECLD, WA_HWLOOP, WA_MMR_STALL, WA_LCREGS,
105         WA_KILLED_MMR, WA_RETS]>;
106  def : Proc<Name, "-0.3",
107        [WA_MI_SHIFT, WA_CSYNC, WA_SPECLD, WA_HWLOOP, WA_MMR_STALL, WA_LCREGS,
108         WA_KILLED_MMR, WA_RETS]>;
109  def : Proc<Name, "-any",
110        [WA_MI_SHIFT, WA_CSYNC, WA_SPECLD, WA_HWLOOP, WA_MMR_STALL, WA_LCREGS,
111         WA_KILLED_MMR, WA_RETS]>;
112}
113multiclass CoreBraemar<string Name>
114       : Core<Name, "-0.3",
115         [WA_MI_SHIFT, WA_SPECLD, WA_LCREGS, WA_RETS, WA_IND_CALL]> {
116  def  : Proc<Name, "-0.2",
117         [WA_MI_SHIFT, WA_CSYNC, WA_SPECLD, WA_HWLOOP, WA_MMR_STALL, WA_LCREGS,
118          WA_KILLED_MMR, WA_RETS, WA_IND_CALL]>;
119  def  : Proc<Name, "-any",
120         [WA_MI_SHIFT, WA_CSYNC, WA_SPECLD, WA_HWLOOP, WA_MMR_STALL, WA_LCREGS,
121          WA_KILLED_MMR, WA_RETS, WA_IND_CALL]>;
122}
123multiclass CoreStirling<string Name>
124      : Core<Name, "-0.5", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]> {
125  def : Proc<Name, "-0.4",
126        [WA_MI_SHIFT, WA_SPECLD, WA_LCREGS, WA_RETS, WA_IND_CALL]>;
127  def : Proc<Name, "-0.3",
128        [WA_MI_SHIFT, WA_SPECLD, WA_MMR_STALL, WA_LCREGS, WA_KILLED_MMR,
129         WA_RETS, WA_IND_CALL]>;
130  def : Proc<Name, "-any",
131        [WA_MI_SHIFT, WA_SPECLD, WA_MMR_STALL, WA_LCREGS, WA_KILLED_MMR,
132         WA_RETS, WA_IND_CALL]>;
133}
134multiclass CoreMoab<string Name>
135      : Core<Name, "-0.3", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]> {
136  def : Proc<Name, "-0.2", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]>;
137  def : Proc<Name, "-0.1", [WA_MI_SHIFT, WA_SPECLD, WA_RETS, WA_IND_CALL]>;
138  def : Proc<Name, "-0.0",
139        [WA_MI_SHIFT, WA_SPECLD, WA_LCREGS, WA_RETS, WA_IND_CALL]>;
140  def : Proc<Name, "-any",
141        [WA_MI_SHIFT, WA_SPECLD, WA_LCREGS, WA_RETS, WA_IND_CALL]>;
142}
143multiclass CoreTeton<string Name>
144      : Core<Name, "-0.5",
145        [WA_MI_SHIFT, WA_SPECLD, WA_MMR_STALL, WA_LCREGS, WA_KILLED_MMR,
146         WA_RETS, WA_IND_CALL]> {
147  def : Proc<Name, "-0.3",
148        [WA_MI_SHIFT, WA_CSYNC, WA_SPECLD, WA_HWLOOP, WA_MMR_STALL, WA_LCREGS,
149         WA_KILLED_MMR, WA_RETS, WA_IND_CALL]>;
150  def : Proc<Name, "-any",
151        [WA_MI_SHIFT, WA_CSYNC, WA_SPECLD, WA_HWLOOP, WA_MMR_STALL, WA_LCREGS,
152         WA_KILLED_MMR, WA_RETS, WA_IND_CALL]>;
153}
154multiclass CoreKookaburra<string Name>
155      : Core<Name, "-0.2", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]> {
156  def : Proc<Name, "-0.1", [WA_MI_SHIFT, WA_SPECLD, WA_RETS, WA_IND_CALL]>;
157  def : Proc<Name, "-0.0", [WA_MI_SHIFT, WA_SPECLD, WA_RETS, WA_IND_CALL]>;
158  def : Proc<Name, "-any", [WA_MI_SHIFT, WA_SPECLD, WA_RETS, WA_IND_CALL]>;
159}
160multiclass CoreMockingbird<string Name>
161      : Core<Name, "-0.1", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]> {
162  def : Proc<Name, "-0.0", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]>;
163  def : Proc<Name, "-any", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]>;
164}
165multiclass CoreBrodie<string Name>
166      : Core<Name, "-0.1", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]> {
167  def : Proc<Name, "-0.0", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]>;
168  def : Proc<Name, "-any", [WA_MI_SHIFT, WA_SPECLD, WA_IND_CALL]>;
169}
170
171defm BF512 : CoreBrodie<"bf512">;
172defm BF514 : CoreBrodie<"bf514">;
173defm BF516 : CoreBrodie<"bf516">;
174defm BF518 : CoreBrodie<"bf518">;
175defm BF522 : CoreMockingbird<"bf522">;
176defm BF523 : CoreKookaburra<"bf523">;
177defm BF524 : CoreMockingbird<"bf524">;
178defm BF525 : CoreKookaburra<"bf525">;
179defm BF526 : CoreMockingbird<"bf526">;
180defm BF527 : CoreKookaburra<"bf527">;
181defm BF531 : CoreEdinburgh<"bf531">;
182defm BF532 : CoreEdinburgh<"bf532">;
183defm BF533 : CoreEdinburgh<"bf533">;
184defm BF534 : CoreBraemar<"bf534">;
185defm BF536 : CoreBraemar<"bf536">;
186defm BF537 : CoreBraemar<"bf537">;
187defm BF538 : CoreStirling<"bf538">;
188defm BF539 : CoreStirling<"bf539">;
189defm BF542 : CoreMoab<"bf542">;
190defm BF544 : CoreMoab<"bf544">;
191defm BF548 : CoreMoab<"bf548">;
192defm BF549 : CoreMoab<"bf549">;
193defm BF561 : CoreTeton<"bf561">;
194
195//===----------------------------------------------------------------------===//
196// Declare the target which we are implementing
197//===----------------------------------------------------------------------===//
198
199def Blackfin : Target {
200  // Pull in Instruction Info:
201  let InstructionSet = BlackfinInstrInfo;
202}
203