diff options
author | Stefan Pintilie <stefanp@ca.ibm.com> | 2023-11-06 12:30:19 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-06 12:30:19 -0500 |
commit | 423ad04c67b7fbe7c6a6b4e0591bff40844c6027 (patch) | |
tree | 989a957d7e94eb3b9e04bd2b8eb46f587cf9b257 /llvm/lib/Target/PowerPC | |
parent | c16b94a3bf60d77cb0ea866af416016e672a43d2 (diff) | |
download | llvm-423ad04c67b7fbe7c6a6b4e0591bff40844c6027.zip llvm-423ad04c67b7fbe7c6a6b4e0591bff40844c6027.tar.gz llvm-423ad04c67b7fbe7c6a6b4e0591bff40844c6027.tar.bz2 |
[PowerPC] Add an alias for -mregnames so that full register names used in assembly. (#70255)
This option already exists on GCC and so it is being added to LLVM so
that we use the same option as them.
Diffstat (limited to 'llvm/lib/Target/PowerPC')
-rw-r--r-- | llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp index 0ee7f9f..ccbb650 100644 --- a/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp +++ b/llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp @@ -13,6 +13,7 @@ #include "MCTargetDesc/PPCInstPrinter.h" #include "MCTargetDesc/PPCMCTargetDesc.h" #include "MCTargetDesc/PPCPredicates.h" +#include "llvm/MC/MCAsmInfo.h" #include "llvm/MC/MCExpr.h" #include "llvm/MC/MCInst.h" #include "llvm/MC/MCInstrInfo.h" @@ -596,7 +597,8 @@ void PPCInstPrinter::printTLSCall(const MCInst *MI, unsigned OpNo, /// showRegistersWithPercentPrefix - Check if this register name should be /// printed with a percentage symbol as prefix. bool PPCInstPrinter::showRegistersWithPercentPrefix(const char *RegName) const { - if (!FullRegNamesWithPercent || TT.getOS() == Triple::AIX) + if ((!FullRegNamesWithPercent && !MAI.useFullRegisterNames()) || + TT.getOS() == Triple::AIX) return false; switch (RegName[0]) { @@ -613,10 +615,10 @@ bool PPCInstPrinter::showRegistersWithPercentPrefix(const char *RegName) const { /// getVerboseConditionalRegName - This method expands the condition register /// when requested explicitly or targetting Darwin. -const char *PPCInstPrinter::getVerboseConditionRegName(unsigned RegNum, - unsigned RegEncoding) - const { - if (!FullRegNames) +const char * +PPCInstPrinter::getVerboseConditionRegName(unsigned RegNum, + unsigned RegEncoding) const { + if (!FullRegNames && !MAI.useFullRegisterNames()) return nullptr; if (RegNum < PPC::CR0EQ || RegNum > PPC::CR7UN) return nullptr; @@ -636,7 +638,7 @@ const char *PPCInstPrinter::getVerboseConditionRegName(unsigned RegNum, // showRegistersWithPrefix - This method determines whether registers // should be number-only or include the prefix. bool PPCInstPrinter::showRegistersWithPrefix() const { - return FullRegNamesWithPercent || FullRegNames; + return FullRegNamesWithPercent || FullRegNames || MAI.useFullRegisterNames(); } void PPCInstPrinter::printOperand(const MCInst *MI, unsigned OpNo, |