BPF.td 1.6 KB

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