10b57cec5SDimitry Andric//===-- BPF.td - Describe the BPF Target Machine -----------*- tablegen -*-===// 20b57cec5SDimitry Andric// 30b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 40b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information. 50b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 60b57cec5SDimitry Andric// 70b57cec5SDimitry Andric//===----------------------------------------------------------------------===// 80b57cec5SDimitry Andric 90b57cec5SDimitry Andricinclude "llvm/Target/Target.td" 100b57cec5SDimitry Andric 110b57cec5SDimitry Andricinclude "BPFRegisterInfo.td" 120b57cec5SDimitry Andricinclude "BPFCallingConv.td" 130b57cec5SDimitry Andricinclude "BPFInstrInfo.td" 14*5f757f3fSDimitry Andricinclude "GISel/BPFRegisterBanks.td" 150b57cec5SDimitry Andric 160b57cec5SDimitry Andricdef BPFInstrInfo : InstrInfo; 170b57cec5SDimitry Andric 180b57cec5SDimitry Andricclass Proc<string Name, list<SubtargetFeature> Features> 190b57cec5SDimitry Andric : Processor<Name, NoItineraries, Features>; 200b57cec5SDimitry Andric 210b57cec5SDimitry Andricdef DummyFeature : SubtargetFeature<"dummy", "isDummyMode", 220b57cec5SDimitry Andric "true", "unused feature">; 230b57cec5SDimitry Andric 240b57cec5SDimitry Andricdef ALU32 : SubtargetFeature<"alu32", "HasAlu32", "true", 250b57cec5SDimitry Andric "Enable ALU32 instructions">; 260b57cec5SDimitry Andric 270b57cec5SDimitry Andricdef DwarfRIS: SubtargetFeature<"dwarfris", "UseDwarfRIS", "true", 280b57cec5SDimitry Andric "Disable MCAsmInfo DwarfUsesRelocationsAcrossSections">; 290b57cec5SDimitry Andric 3006c3fb27SDimitry Andricdef : Proc<"generic", []>; 3106c3fb27SDimitry Andricdef : Proc<"v1", []>; 3206c3fb27SDimitry Andricdef : Proc<"v2", []>; 3306c3fb27SDimitry Andricdef : Proc<"v3", [ALU32]>; 34*5f757f3fSDimitry Andricdef : Proc<"v4", [ALU32]>; 3506c3fb27SDimitry Andricdef : Proc<"probe", []>; 3606c3fb27SDimitry Andric 370b57cec5SDimitry Andricdef BPFInstPrinter : AsmWriter { 380b57cec5SDimitry Andric string AsmWriterClassName = "InstPrinter"; 390b57cec5SDimitry Andric bit isMCAsmWriter = 1; 400b57cec5SDimitry Andric} 410b57cec5SDimitry Andric 420b57cec5SDimitry Andricdef BPFAsmParser : AsmParser { 430b57cec5SDimitry Andric bit HasMnemonicFirst = 0; 440b57cec5SDimitry Andric} 450b57cec5SDimitry Andric 460b57cec5SDimitry Andricdef BPFAsmParserVariant : AsmParserVariant { 470b57cec5SDimitry Andric int Variant = 0; 480b57cec5SDimitry Andric string Name = "BPF"; 490b57cec5SDimitry Andric string BreakCharacters = "."; 50*5f757f3fSDimitry Andric string TokenizingCharacters = "#()[]=:.<>!+*%/"; 510b57cec5SDimitry Andric} 520b57cec5SDimitry Andric 530b57cec5SDimitry Andricdef BPF : Target { 540b57cec5SDimitry Andric let InstructionSet = BPFInstrInfo; 550b57cec5SDimitry Andric let AssemblyWriters = [BPFInstPrinter]; 560b57cec5SDimitry Andric let AssemblyParsers = [BPFAsmParser]; 570b57cec5SDimitry Andric let AssemblyParserVariants = [BPFAsmParserVariant]; 580b57cec5SDimitry Andric} 59