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