xref: /freebsd/contrib/llvm-project/llvm/lib/Target/X86/MCTargetDesc/X86InstPrinterCommon.h (revision c7a063741720ef81d4caa4613242579d12f1d605)
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 
14 #ifndef LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INSTPRINTERCOMMON_H
15 #define LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INSTPRINTERCOMMON_H
16 
17 #include "llvm/MC/MCInstPrinter.h"
18 
19 namespace llvm {
20 
21 class X86InstPrinterCommon : public MCInstPrinter {
22 public:
23   using MCInstPrinter::MCInstPrinter;
24 
25   virtual void printOperand(const MCInst *MI, unsigned OpNo, raw_ostream &O) = 0;
26   void printCondCode(const MCInst *MI, unsigned Op, raw_ostream &OS);
27   void printSSEAVXCC(const MCInst *MI, unsigned Op, raw_ostream &OS);
28   void printVPCOMMnemonic(const MCInst *MI, raw_ostream &OS);
29   void printVPCMPMnemonic(const MCInst *MI, raw_ostream &OS);
30   void printCMPMnemonic(const MCInst *MI, bool IsVCmp, raw_ostream &OS);
31   void printRoundingControl(const MCInst *MI, unsigned Op, raw_ostream &O);
32   void printPCRelImm(const MCInst *MI, uint64_t Address, unsigned OpNo,
33                      raw_ostream &O);
34 
35 protected:
36   void printInstFlags(const MCInst *MI, raw_ostream &O);
37   void printOptionalSegReg(const MCInst *MI, unsigned OpNo, raw_ostream &O);
38   void printVKPair(const MCInst *MI, unsigned OpNo, raw_ostream &OS);
39 };
40 
41 } // end namespace llvm
42 
43 #endif // LLVM_LIB_TARGET_X86_MCTARGETDESC_X86INSTPRINTERCOMMON_H
44