NVPTXInstPrinter.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. //= NVPTXInstPrinter.h - Convert NVPTX MCInst to assembly syntax --*- C++ -*-=//
  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. //
  9. // This class prints an NVPTX MCInst to .ptx file syntax.
  10. //
  11. //===----------------------------------------------------------------------===//
  12. #ifndef LLVM_LIB_TARGET_NVPTX_MCTARGETDESC_NVPTXINSTPRINTER_H
  13. #define LLVM_LIB_TARGET_NVPTX_MCTARGETDESC_NVPTXINSTPRINTER_H
  14. #include "llvm/MC/MCInstPrinter.h"
  15. namespace llvm {
  16. class MCSubtargetInfo;
  17. class NVPTXInstPrinter : public MCInstPrinter {
  18. public:
  19. NVPTXInstPrinter(const MCAsmInfo &MAI, const MCInstrInfo &MII,
  20. const MCRegisterInfo &MRI);
  21. void printRegName(raw_ostream &OS, unsigned RegNo) const override;
  22. void printInst(const MCInst *MI, uint64_t Address, StringRef Annot,
  23. const MCSubtargetInfo &STI, raw_ostream &OS) override;
  24. // Autogenerated by tblgen.
  25. std::pair<const char *, uint64_t> getMnemonic(const MCInst *MI) override;
  26. void printInstruction(const MCInst *MI, uint64_t Address, raw_ostream &O);
  27. static const char *getRegisterName(unsigned RegNo);
  28. // End
  29. void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O);
  30. void printCvtMode(const MCInst *MI, int OpNum, raw_ostream &O,
  31. const char *Modifier = nullptr);
  32. void printCmpMode(const MCInst *MI, int OpNum, raw_ostream &O,
  33. const char *Modifier = nullptr);
  34. void printLdStCode(const MCInst *MI, int OpNum,
  35. raw_ostream &O, const char *Modifier = nullptr);
  36. void printMmaCode(const MCInst *MI, int OpNum, raw_ostream &O,
  37. const char *Modifier = nullptr);
  38. void printMemOperand(const MCInst *MI, int OpNum,
  39. raw_ostream &O, const char *Modifier = nullptr);
  40. void printProtoIdent(const MCInst *MI, int OpNum,
  41. raw_ostream &O, const char *Modifier = nullptr);
  42. };
  43. }
  44. #endif