1//===-- BPF.td - Describe the BPF 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
10include "llvm/Target/Target.td"
11
12include "BPFRegisterInfo.td"
13include "BPFCallingConv.td"
14include "BPFInstrInfo.td"
15
16def BPFInstrInfo : InstrInfo;
17
18class Proc<string Name, list<SubtargetFeature> Features>
19 : Processor<Name, NoItineraries, Features>;
20
21def : Proc<"generic", []>;
22def : Proc<"v1", []>;
23def : Proc<"v2", []>;
24def : Proc<"probe", []>;
25
26def DummyFeature : SubtargetFeature<"dummy", "isDummyMode",
27                                    "true", "unused feature">;
28
29def ALU32 : SubtargetFeature<"alu32", "HasAlu32", "true",
30                             "Enable ALU32 instructions">;
31
32def DwarfRIS: SubtargetFeature<"dwarfris", "UseDwarfRIS", "true",
33                               "Disable MCAsmInfo DwarfUsesRelocationsAcrossSections">;
34
35def BPFInstPrinter : AsmWriter {
36  string AsmWriterClassName  = "InstPrinter";
37  bit isMCAsmWriter = 1;
38}
39
40def BPFAsmParser : AsmParser {
41  bit HasMnemonicFirst = 0;
42}
43
44def BPFAsmParserVariant : AsmParserVariant {
45  int Variant = 0;
46  string Name = "BPF";
47  string BreakCharacters = ".";
48  string TokenizingCharacters = "#()[]=:.<>!+*";
49}
50
51def BPF : Target {
52  let InstructionSet = BPFInstrInfo;
53  let AssemblyWriters = [BPFInstPrinter];
54  let AssemblyParsers = [BPFAsmParser];
55  let AssemblyParserVariants = [BPFAsmParserVariant];
56}
57