X86InstPrinterCommon.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. //===-- X86InstPrinterCommon.cpp - X86 assembly instruction printing ------===//
  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 file includes code common for rendering MCInst instances as AT&T-style
  10. // and Intel-style assembly.
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INSTPRINTERCOMMON_H
  14. #define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INSTPRINTERCOMMON_H
  15. #include "llvm/MC/MCInstPrinter.h"
  16. namespace llvm {
  17. class X86InstPrinterCommon : public MCInstPrinter {
  18. public:
  19. using MCInstPrinter::MCInstPrinter;
  20. virtual void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) = 0;
  21. void printCondCode(const MCInst *MI, unsigned Op, raw_ostream &OS);
  22. void printSSEAVXCC(const MCInst *MI, unsigned Op, raw_ostream &OS);
  23. void printVPCOMMnemonic(const MCInst *MI, raw_ostream &OS);
  24. void printVPCMPMnemonic(const MCInst *MI, raw_ostream &OS);
  25. void printCMPMnemonic(const MCInst *MI, bool IsVCmp, raw_ostream &OS);
  26. void printRoundingControl(const MCInst *MI, unsigned Op, raw_ostream &O);
  27. void printPCRelImm(const MCInst *MI, uint64_t Address, unsigned OpNo,
  28. raw_ostream &O);
  29. protected:
  30. void printInstFlags(const MCInst *MI, raw_ostream &O);
  31. void printOptionalSegReg(const MCInst *MI, unsigned OpNo, raw_ostream &O);
  32. void printVKPair(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
  33. };
  34. } // end namespace llvm
  35. #endif // LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INSTPRINTERCOMMON_H