1 //===-- M68k.td - Motorola 680x0 target definitions --------*- 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 //===----------------------------------------------------------------------===//
10 /// This is a target description file for the Motorola 680x0 family, referred
11 /// to here as the "M68k" architecture.
13 //===----------------------------------------------------------------------===//
15 include "llvm/Target/Target.td"
17 //===----------------------------------------------------------------------===//
18 // M68k Subtarget features
19 //===----------------------------------------------------------------------===//
22 : SubtargetFeature<"isa-68000", "SubtargetKind", "M00",
23 "Is M68000 ISA supported">;
26 : SubtargetFeature<"isa-68010", "SubtargetKind", "M10",
27 "Is M68010 ISA supported",
31 : SubtargetFeature<"isa-68020", "SubtargetKind", "M20",
32 "Is M68020 ISA supported",
36 : SubtargetFeature<"isa-68030", "SubtargetKind", "M30",
37 "Is M68030 ISA supported",
41 : SubtargetFeature<"isa-68040", "SubtargetKind", "M40",
42 "Is M68040 ISA supported",
46 : SubtargetFeature<"isa-68060", "SubtargetKind", "M60",
47 "Is M68060 ISA supported",
51 def FeatureReserveA#i :
52 SubtargetFeature<"reserve-a"#i, "UserReservedRegister[M68k::A"#i#"]",
53 "true", "Reserve A"#i#" register">;
55 def FeatureReserveD#i :
56 SubtargetFeature<"reserve-d"#i, "UserReservedRegister[M68k::D"#i#"]",
57 "true", "Reserve D"#i#" register">;
59 //===----------------------------------------------------------------------===//
60 // M68k processors supported.
61 //===----------------------------------------------------------------------===//
63 include "M68kSchedule.td"
65 class Proc<string Name, list<SubtargetFeature> Features>
66 : ProcessorModel<Name, GenericM68kModel, Features>;
68 def : Proc<"generic", [ FeatureISA00 ]>;
69 def : Proc<"M68000", [ FeatureISA00 ]>;
70 def : Proc<"M68010", [ FeatureISA10 ]>;
71 def : Proc<"M68020", [ FeatureISA20 ]>;
72 def : Proc<"M68030", [ FeatureISA30 ]>;
73 def : Proc<"M68040", [ FeatureISA40 ]>;
74 def : Proc<"M68060", [ FeatureISA60 ]>;
76 //===----------------------------------------------------------------------===//
77 // Register File Description
78 //===----------------------------------------------------------------------===//
80 include "M68kRegisterInfo.td"
81 include "GISel/M68kRegisterBanks.td"
83 //===----------------------------------------------------------------------===//
84 // Instruction Descriptions
85 //===----------------------------------------------------------------------===//
87 include "M68kInstrInfo.td"
89 def M68kInstrInfo : InstrInfo;
91 //===----------------------------------------------------------------------===//
92 // Calling Conventions
93 //===----------------------------------------------------------------------===//
95 include "M68kCallingConv.td"
97 //===---------------------------------------------------------------------===//
99 //===---------------------------------------------------------------------===//
101 def M68kAsmWriter : AsmWriter {
102 string AsmWriterClassName = "InstPrinter";
103 bit isMCAsmWriter = 1;
106 //===---------------------------------------------------------------------===//
108 //===---------------------------------------------------------------------===//
110 def M68kAsmParser : AsmParser {
111 let ShouldEmitMatchRegisterName = 0;
112 let ShouldEmitMatchRegisterAltName = 0;
115 def M68kAsmParserVariant : AsmParserVariant {
119 //===----------------------------------------------------------------------===//
121 //===----------------------------------------------------------------------===//
124 let InstructionSet = M68kInstrInfo;
125 let AssemblyParsers = [M68kAsmParser];
126 let AssemblyWriters = [M68kAsmWriter];