================
@@ -12,29 +12,411 @@
//===----------------------------------------------------------------------===//
#include "PISAInstPrinter.h"
+#include "MCTargetDesc/PISARegEncoder.h"
+#include "PISA.h"
+#include "PISABaseInfo.h"
+#include "PISAEnum.h"
+#include "PISAInstrInfo.h"
+#include "PISAMCExpr.h"
+#include "PISAMCInstLower.h"
+#include "PISAUtils.h"
+
+#include "llvm/ADT/StringExtras.h"
+#include "llvm/MC/MCAsmInfo.h"
+#include "llvm/MC/MCExpr.h"
#include "llvm/MC/MCInst.h"
-#include "llvm/Support/raw_ostream.h"
+#include "llvm/MC/MCInstrInfo.h"
+#include "llvm/MC/MCSymbol.h"
+#include "llvm/Support/Casting.h"
+#include "llvm/Support/CommandLine.h"
+#include "llvm/Support/ErrorHandling.h"
+#include "llvm/Support/FormattedStream.h"
using namespace llvm;
+using namespace llvm::PISA;
-#include "PISAGenAsmWriter.inc"
+#define DEBUG_TYPE "asm-printer"
-void PISAInstPrinter::printRegName(raw_ostream &OS, MCRegister Reg) {
- OS << getRegisterName(Reg);
-}
+static cl::opt<bool>
+ AlwaysPrintDefaultValue("pisa-always-print-default-value",
+ cl::desc("Always print default value"),
+ cl::init(false), cl::ReallyHidden);
+
+// Include the auto-generated portion of the assembly writer.
+#include "PISAGenAsmWriter.inc"
void PISAInstPrinter::printInst(const MCInst *MI, uint64_t Address,
StringRef Annot, const MCSubtargetInfo &STI,
raw_ostream &OS) {
+ this->STI = &STI;
+
printInstruction(MI, Address, OS);
+
printAnnotation(OS, Annot);
}
-void PISAInstPrinter::printOperand(const MCInst *MI, unsigned OpNo,
+void PISAInstPrinter::printRegName(raw_ostream &OS, MCRegister Reg) {
+ if (MCRegister::isPhysicalRegister(Reg)) {
----------------
topperc wrote:
```suggestion
if (Reg.isPhysical()) {
```
https://github.com/llvm/llvm-project/pull/214107
_______________________________________________
llvm-branch-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits