Page MenuHomePhabricator

[PowerPC] Support ppc-asm-full-reg-names for AIX
Needs ReviewPublic

Authored by qiucf on Jan 7 2021, 7:14 PM.

Details

Reviewers
nemanjai
steven.zhang
jsji
joerg
Group Reviewers
Restricted Project
Summary

This restriction was introduced in D39016.

Diff Detail

Event Timeline

qiucf created this revision.Jan 7 2021, 7:14 PM
qiucf requested review of this revision.Jan 7 2021, 7:14 PM
Herald added a project: Restricted Project. · View Herald TranscriptJan 7 2021, 7:14 PM
steven.zhang added inline comments.Jan 7 2021, 11:32 PM
llvm/lib/Target/PowerPC/MCTargetDesc/PPCInstPrinter.cpp
599
bool PPCInstPrinter::showRegistersWithPercentPrefix(const char *RegName) const {
  if (!FullRegNamesWithPercent || TT.getOS() == Triple::AIX)
    return false;

Could you please double confirm on why we need this check for AIX.

Historically, the letter prefixes were always stripped out because AIX and Linux assemblers don't accept them. The mentioned patch added the ability to produce prefixes with percent sign and letter which is actually accepted by the Linux assembler (GNU as). It was thought (not known) at the time that AIX does not accept this %<letter> syntax either so the guard for AIX was kept. If you can confirm that the AIX system assembler accepts this syntax, then this is fine.

I suppose it is fine either way since we never took the extra step of making -ppc-reg-with-percent-prefix the default, but if we do choose to make that the default at some point, we can only do so if the AIX assembler also supports it.

qiucf added a comment.Jan 17 2021, 7:28 PM

Historically, the letter prefixes were always stripped out because AIX and Linux assemblers don't accept them. The mentioned patch added the ability to produce prefixes with percent sign and letter which is actually accepted by the Linux assembler (GNU as). It was thought (not known) at the time that AIX does not accept this %<letter> syntax either so the guard for AIX was kept. If you can confirm that the AIX system assembler accepts this syntax, then this is fine.

I suppose it is fine either way since we never took the extra step of making -ppc-reg-with-percent-prefix the default, but if we do choose to make that the default at some point, we can only do so if the AIX assembler also supports it.

Thanks for the historical information. I saw GNU as on AIX supports -mregnames/-mno-regnames and accepts assembly with regname or precent prefixes, but did not found any such option from AIX system assembler. And LLVM MC assembler also doesn't work since AsmParser for XCOFF is not ready yet.