From 7c5cb066d091eed948d0ef10bb15b9def37b81ab Mon Sep 17 00:00:00 2001 From: Hal Finkel Date: Thu, 23 Apr 2015 18:30:38 +0000 Subject: [PowerPC] Enable printing instructions using aliases TableGen had been nicely generating code to print a number of instructions using shorter aliases (and PowerPC has plenty of short mnemonics), but we were not calling it. For some of the aliases we support in the parser, TableGen can't infer the "inverse" alias relationship, so there is still more to do. Thus, after some hours of updating test cases... llvm-svn: 235616 --- llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp') diff --git a/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp b/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp index 15765440e87..046682ddfc3 100644 --- a/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp +++ b/llvm/lib/Target/PowerPC/InstPrinter/PPCInstPrinter.cpp @@ -31,6 +31,7 @@ static cl::opt FullRegNames("ppc-asm-full-reg-names", cl::Hidden, cl::init(false), cl::desc("Use full register names when printing assembly")); +#define PRINT_ALIAS_INSTR #include "PPCGenAsmWriter.inc" void PPCInstPrinter::printRegName(raw_ostream &OS, unsigned RegNo) const { @@ -111,8 +112,9 @@ void PPCInstPrinter::printInst(const MCInst *MI, raw_ostream &O, // precision). FIXME: Is there a better solution? if (MI->getOpcode() == TargetOpcode::COPY_TO_REGCLASS) return; - - printInstruction(MI, O); + + if (!printAliasInstr(MI, O)) + printInstruction(MI, O); printAnnotation(O, Annot); } -- cgit v1.2.3