1 //===-- BPF.td - Describe the BPF Target Machine -----------*- 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 include "llvm/Target/Target.td"
11 include "BPFRegisterInfo.td"
12 include "BPFCallingConv.td"
13 include "BPFInstrInfo.td"
15 def BPFInstrInfo : InstrInfo;
17 class Proc<string Name, list<SubtargetFeature> Features>
18 : Processor<Name, NoItineraries, Features>;
20 def : Proc<"generic", []>;
24 def : Proc<"probe", []>;
26 def DummyFeature : SubtargetFeature<"dummy", "isDummyMode",
27 "true", "unused feature">;
29 def ALU32 : SubtargetFeature<"alu32", "HasAlu32", "true",
30 "Enable ALU32 instructions">;
32 def DwarfRIS: SubtargetFeature<"dwarfris", "UseDwarfRIS", "true",
33 "Disable MCAsmInfo DwarfUsesRelocationsAcrossSections">;
35 def BPFInstPrinter : AsmWriter {
36 string AsmWriterClassName = "InstPrinter";
37 bit isMCAsmWriter = 1;
40 def BPFAsmParser : AsmParser {
41 bit HasMnemonicFirst = 0;
44 def BPFAsmParserVariant : AsmParserVariant {
47 string BreakCharacters = ".";
48 string TokenizingCharacters = "#()[]=:.<>!+*";
52 let InstructionSet = BPFInstrInfo;
53 let AssemblyWriters = [BPFInstPrinter];
54 let AssemblyParsers = [BPFAsmParser];
55 let AssemblyParserVariants = [BPFAsmParserVariant];