xref: /freebsd/contrib/llvm-project/llvm/lib/Target/MSP430/MSP430.td (revision 62cfcf62f627e5093fb37026a6d8c98e4d2ef04c)
1//===-- MSP430.td - Describe the MSP430 Target Machine -----*- tablegen -*-===//
2//
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
6//
7//===----------------------------------------------------------------------===//
8// This is the top level entry point for the MSP430 target.
9//===----------------------------------------------------------------------===//
10
11//===----------------------------------------------------------------------===//
12// Target-independent interfaces
13//===----------------------------------------------------------------------===//
14
15include "llvm/Target/Target.td"
16
17//===----------------------------------------------------------------------===//
18// Subtarget Features.
19//===----------------------------------------------------------------------===//
20def FeatureX
21 : SubtargetFeature<"ext", "ExtendedInsts", "true",
22                    "Enable MSP430-X extensions">;
23
24def FeatureHWMult16
25 : SubtargetFeature<"hwmult16", "HWMultMode", "HWMult16",
26                    "Enable 16-bit hardware multiplier">;
27
28def FeatureHWMult32
29 : SubtargetFeature<"hwmult32", "HWMultMode", "HWMult32",
30                    "Enable 32-bit hardware multiplier">;
31
32def FeatureHWMultF5
33 : SubtargetFeature<"hwmultf5", "HWMultMode", "HWMultF5",
34                    "Enable F5 series hardware multiplier">;
35
36//===----------------------------------------------------------------------===//
37// MSP430 supported processors.
38//===----------------------------------------------------------------------===//
39class Proc<string Name, list<SubtargetFeature> Features>
40 : Processor<Name, NoItineraries, Features>;
41
42def : Proc<"generic",         []>;
43def : Proc<"msp430",          []>;
44def : Proc<"msp430x",         [FeatureX]>;
45
46//===----------------------------------------------------------------------===//
47// Register File Description
48//===----------------------------------------------------------------------===//
49
50include "MSP430RegisterInfo.td"
51
52//===----------------------------------------------------------------------===//
53// Calling Convention Description
54//===----------------------------------------------------------------------===//
55
56include "MSP430CallingConv.td"
57
58//===----------------------------------------------------------------------===//
59// Instruction Descriptions
60//===----------------------------------------------------------------------===//
61
62include "MSP430InstrInfo.td"
63
64def MSP430InstrInfo : InstrInfo;
65
66//===---------------------------------------------------------------------===//
67// Assembly Printers
68//===---------------------------------------------------------------------===//
69
70def MSP430AsmWriter : AsmWriter {
71  string AsmWriterClassName = "InstPrinter";
72}
73
74//===---------------------------------------------------------------------===//
75// Assembly Parsers
76//===---------------------------------------------------------------------===//
77
78def MSP430AsmParser : AsmParser {
79  let AllowDuplicateRegisterNames = 1;
80  let ShouldEmitMatchRegisterAltName = 1;
81}
82
83//===----------------------------------------------------------------------===//
84// Target Declaration
85//===----------------------------------------------------------------------===//
86
87def MSP430 : Target {
88  let InstructionSet = MSP430InstrInfo;
89  let AssemblyParsers = [MSP430AsmParser];
90}
91
92