[llvm-branch-commits] [llvm-branch] r92848 - in /llvm/branches/Apple/Zoidberg/lib/Target/PowerPC: AsmPrinter/PPCAsmPrinter.cpp PPCMCAsmInfo.cpp
Dale Johannesen
dalej at apple.com
Wed Jan 6 10:43:43 PST 2010
Author: johannes
Date: Wed Jan 6 12:43:42 2010
New Revision: 92848
URL: http://llvm.org/viewvc/llvm-project?rev=92848&view=rev
Log:
--- Merging r92817 into '.':
U lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
--- Merging r92818 into '.':
U lib/Target/PowerPC/PPCMCAsmInfo.cpp
Modified:
llvm/branches/Apple/Zoidberg/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
llvm/branches/Apple/Zoidberg/lib/Target/PowerPC/PPCMCAsmInfo.cpp
Modified: llvm/branches/Apple/Zoidberg/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp?rev=92848&r1=92847&r2=92848&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp Wed Jan 6 12:43:42 2010
@@ -550,50 +550,49 @@
processDebugLoc(MI, true);
// Check for slwi/srwi mnemonics.
+ bool useSubstituteMnemonic = false;
if (MI->getOpcode() == PPC::RLWINM) {
- bool FoundMnemonic = false;
unsigned char SH = MI->getOperand(2).getImm();
unsigned char MB = MI->getOperand(3).getImm();
unsigned char ME = MI->getOperand(4).getImm();
if (SH <= 31 && MB == 0 && ME == (31-SH)) {
- O << "\tslwi "; FoundMnemonic = true;
+ O << "\tslwi "; useSubstituteMnemonic = true;
}
if (SH <= 31 && MB == (32-SH) && ME == 31) {
- O << "\tsrwi "; FoundMnemonic = true;
+ O << "\tsrwi "; useSubstituteMnemonic = true;
SH = 32-SH;
}
- if (FoundMnemonic) {
+ if (useSubstituteMnemonic) {
printOperand(MI, 0);
O << ", ";
printOperand(MI, 1);
- O << ", " << (unsigned int)SH << '\n';
- return;
+ O << ", " << (unsigned int)SH;
}
} else if (MI->getOpcode() == PPC::OR || MI->getOpcode() == PPC::OR8) {
if (MI->getOperand(1).getReg() == MI->getOperand(2).getReg()) {
+ useSubstituteMnemonic = true;
O << "\tmr ";
printOperand(MI, 0);
O << ", ";
printOperand(MI, 1);
- O << '\n';
- return;
}
} else if (MI->getOpcode() == PPC::RLDICR) {
unsigned char SH = MI->getOperand(2).getImm();
unsigned char ME = MI->getOperand(3).getImm();
// rldicr RA, RS, SH, 63-SH == sldi RA, RS, SH
if (63-SH == ME) {
+ useSubstituteMnemonic = true;
O << "\tsldi ";
printOperand(MI, 0);
O << ", ";
printOperand(MI, 1);
- O << ", " << (unsigned int)SH << '\n';
- return;
+ O << ", " << (unsigned int)SH;
}
}
- printInstruction(MI);
-
+ if (!useSubstituteMnemonic)
+ printInstruction(MI);
+
if (VerboseAsm)
EmitComments(*MI);
O << '\n';
Modified: llvm/branches/Apple/Zoidberg/lib/Target/PowerPC/PPCMCAsmInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Zoidberg/lib/Target/PowerPC/PPCMCAsmInfo.cpp?rev=92848&r1=92847&r2=92848&view=diff
==============================================================================
--- llvm/branches/Apple/Zoidberg/lib/Target/PowerPC/PPCMCAsmInfo.cpp (original)
+++ llvm/branches/Apple/Zoidberg/lib/Target/PowerPC/PPCMCAsmInfo.cpp Wed Jan 6 12:43:42 2010
@@ -22,6 +22,7 @@
if (!is64Bit)
Data64bitsDirective = 0; // We can't emit a 64-bit unit in PPC32 mode.
AssemblerDialect = 1; // New-Style mnemonics.
+ SupportsDebugInformation= true; // Debug information.
}
PPCLinuxMCAsmInfo::PPCLinuxMCAsmInfo(bool is64Bit) {
More information about the llvm-branch-commits
mailing list