1 //===-- RISCVProcessors.td - RISC-V Processors -------------*- tablegen -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 //===----------------------------------------------------------------------===//
10 // RISC-V processors supported.
11 //===----------------------------------------------------------------------===//
14 bits<8> PrefFunctionAlignment = 1;
15 bits<8> PrefLoopAlignment = 1;
17 // Information needed by LoopDataPrefetch.
18 bits<16> CacheLineSize = 0;
19 bits<16> PrefetchDistance = 0;
20 bits<16> MinPrefetchStride = 1;
21 bits<32> MaxPrefetchIterationsAhead = -1;
23 bits<32> MinimumJumpTableEntries = 5;
26 def RISCVTuneInfoTable : GenericTable {
27 let FilterClass = "RISCVTuneInfo";
28 let CppTypeName = "RISCVTuneInfo";
29 let Fields = ["Name", "PrefFunctionAlignment", "PrefLoopAlignment",
30 "CacheLineSize", "PrefetchDistance",
31 "MinPrefetchStride", "MaxPrefetchIterationsAhead",
32 "MinimumJumpTableEntries"];
35 def getRISCVTuneInfo : SearchIndex {
36 let Table = RISCVTuneInfoTable;
40 class GenericTuneInfo: RISCVTuneInfo;
42 class RISCVProcessorModel<string n,
44 list<SubtargetFeature> f,
45 list<SubtargetFeature> tunef = [],
46 string default_march = "">
47 : ProcessorModel<n, m, f, tunef> {
48 string DefaultMarch = default_march;
51 class RISCVTuneProcessorModel<string n,
53 list<SubtargetFeature> tunef = [],
54 list<SubtargetFeature> f = []>
55 : ProcessorModel<n, m, f,tunef>;
57 def GENERIC_RV32 : RISCVProcessorModel<"generic-rv32",
61 def GENERIC_RV64 : RISCVProcessorModel<"generic-rv64",
65 // Support generic for compatibility with other targets. The triple will be used
66 // to change to the appropriate rv32/rv64 version.
67 def : ProcessorModel<"generic", NoSchedModel, []>, GenericTuneInfo;
69 def ROCKET_RV32 : RISCVProcessorModel<"rocket-rv32",
72 FeatureStdExtZifencei,
74 def ROCKET_RV64 : RISCVProcessorModel<"rocket-rv64",
77 FeatureStdExtZifencei,
79 def ROCKET : RISCVTuneProcessorModel<"rocket",
82 def SIFIVE_7 : RISCVTuneProcessorModel<"sifive-7-series",
86 def SIFIVE_E20 : RISCVProcessorModel<"sifive-e20",
90 FeatureStdExtZifencei,
94 def SIFIVE_E21 : RISCVProcessorModel<"sifive-e21",
98 FeatureStdExtZifencei,
103 def SIFIVE_E24 : RISCVProcessorModel<"sifive-e24",
106 FeatureStdExtZifencei,
112 def SIFIVE_E31 : RISCVProcessorModel<"sifive-e31",
115 FeatureStdExtZifencei,
121 def SIFIVE_E34 : RISCVProcessorModel<"sifive-e34",
124 FeatureStdExtZifencei,
130 def SIFIVE_E76 : RISCVProcessorModel<"sifive-e76",
133 FeatureStdExtZifencei,
140 def SIFIVE_S21 : RISCVProcessorModel<"sifive-s21",
144 FeatureStdExtZifencei,
149 def SIFIVE_S51 : RISCVProcessorModel<"sifive-s51",
153 FeatureStdExtZifencei,
158 def SIFIVE_S54 : RISCVProcessorModel<"sifive-s54",
161 FeatureStdExtZifencei,
168 def SIFIVE_S76 : RISCVProcessorModel<"sifive-s76",
171 FeatureStdExtZifencei,
177 FeatureStdExtZihintpause],
180 def SIFIVE_U54 : RISCVProcessorModel<"sifive-u54",
183 FeatureStdExtZifencei,
190 def SIFIVE_U74 : RISCVProcessorModel<"sifive-u74",
193 FeatureStdExtZifencei,
201 def SIFIVE_X280 : RISCVProcessorModel<"sifive-x280", SiFive7Model,
203 FeatureStdExtZifencei,
210 FeatureStdExtZvl512b,
218 def SIFIVE_P450 : RISCVProcessorModel<"sifive-p450", SiFiveP400Model,
220 FeatureStdExtZifencei,
231 FeatureStdExtZiccamoa,
233 FeatureStdExtZicclsm,
234 FeatureStdExtZiccrse,
235 FeatureStdExtZihintntl,
236 FeatureStdExtZihintpause,
242 FeatureFastUnalignedAccess],
243 [TuneNoDefaultUnroll,
244 TuneConditionalCompressedMoveFusion,
246 TuneAUIPCADDIFusion]>;
248 def SIFIVE_P670 : RISCVProcessorModel<"sifive-p670", NoSchedModel,
250 FeatureStdExtZifencei,
261 FeatureStdExtZiccamoa,
263 FeatureStdExtZicclsm,
264 FeatureStdExtZiccrse,
265 FeatureStdExtZihintntl,
266 FeatureStdExtZihintpause,
273 FeatureStdExtZvl128b,
279 FeatureFastUnalignedAccess],
280 [TuneNoDefaultUnroll,
281 TuneConditionalCompressedMoveFusion,
283 TuneAUIPCADDIFusion]>;
285 def SYNTACORE_SCR1_BASE : RISCVProcessorModel<"syntacore-scr1-base",
289 FeatureStdExtZifencei,
291 [TuneNoDefaultUnroll]>;
293 def SYNTACORE_SCR1_MAX : RISCVProcessorModel<"syntacore-scr1-max",
297 FeatureStdExtZifencei,
300 [TuneNoDefaultUnroll]>;
302 def VENTANA_VEYRON_V1 : RISCVProcessorModel<"veyron-v1",
305 FeatureStdExtZifencei,
309 FeatureStdExtZihintpause,
322 FeatureVendorXVentanaCondOps],
328 TuneShiftedZExtWFusion,
331 def XIANGSHAN_NANHU : RISCVProcessorModel<"xiangshan-nanhu",
335 FeatureStdExtZifencei,
348 FeatureStdExtSvinval,
350 FeatureStdExtZicboz]>;