• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//===-- BPF.td - Describe the BPF 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
9include "llvm/Target/Target.td"
10
11include "BPFRegisterInfo.td"
12include "BPFCallingConv.td"
13include "BPFInstrInfo.td"
14
15def BPFInstrInfo : InstrInfo;
16
17class Proc<string Name, list<SubtargetFeature> Features>
18 : Processor<Name, NoItineraries, Features>;
19
20def : Proc<"generic", []>;
21def : Proc<"v1", []>;
22def : Proc<"v2", []>;
23def : Proc<"v3", []>;
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