mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-10 18:34:09 +00:00
reduce nesting and code duplication in AsmPrinter::EmitGlobalConstantLargeInt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93292 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
3cc3a00570
commit
5979dfff8e
@ -1260,39 +1260,34 @@ void AsmPrinter::EmitGlobalConstantLargeInt(const ConstantInt *CI,
|
|||||||
else
|
else
|
||||||
Val = RawData[i];
|
Val = RawData[i];
|
||||||
|
|
||||||
if (MAI->getData64bitsDirective(AddrSpace))
|
if (MAI->getData64bitsDirective(AddrSpace)) {
|
||||||
O << MAI->getData64bitsDirective(AddrSpace) << Val << '\n';
|
O << MAI->getData64bitsDirective(AddrSpace) << Val << '\n';
|
||||||
else if (TD->isBigEndian()) {
|
continue;
|
||||||
O << MAI->getData32bitsDirective(AddrSpace) << unsigned(Val >> 32);
|
|
||||||
if (VerboseAsm) {
|
|
||||||
O.PadToColumn(MAI->getCommentColumn());
|
|
||||||
O << MAI->getCommentString()
|
|
||||||
<< " most significant half of i64 " << Val;
|
|
||||||
}
|
|
||||||
O << '\n';
|
|
||||||
O << MAI->getData32bitsDirective(AddrSpace) << unsigned(Val);
|
|
||||||
if (VerboseAsm) {
|
|
||||||
O.PadToColumn(MAI->getCommentColumn());
|
|
||||||
O << MAI->getCommentString()
|
|
||||||
<< " least significant half of i64 " << Val;
|
|
||||||
}
|
|
||||||
O << '\n';
|
|
||||||
} else {
|
|
||||||
O << MAI->getData32bitsDirective(AddrSpace) << unsigned(Val);
|
|
||||||
if (VerboseAsm) {
|
|
||||||
O.PadToColumn(MAI->getCommentColumn());
|
|
||||||
O << MAI->getCommentString()
|
|
||||||
<< " least significant half of i64 " << Val;
|
|
||||||
}
|
|
||||||
O << '\n';
|
|
||||||
O << MAI->getData32bitsDirective(AddrSpace) << unsigned(Val >> 32);
|
|
||||||
if (VerboseAsm) {
|
|
||||||
O.PadToColumn(MAI->getCommentColumn());
|
|
||||||
O << MAI->getCommentString()
|
|
||||||
<< " most significant half of i64 " << Val;
|
|
||||||
}
|
|
||||||
O << '\n';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Emit two 32-bit chunks, order depends on endianness.
|
||||||
|
unsigned FirstChunk = unsigned(Val), SecondChunk = unsigned(Val >> 32);
|
||||||
|
const char *FirstName = " least", *SecondName = " most";
|
||||||
|
if (TD->isBigEndian()) {
|
||||||
|
std::swap(FirstChunk, SecondChunk);
|
||||||
|
std::swap(FirstName, SecondName);
|
||||||
|
}
|
||||||
|
|
||||||
|
O << MAI->getData32bitsDirective(AddrSpace) << FirstChunk;
|
||||||
|
if (VerboseAsm) {
|
||||||
|
O.PadToColumn(MAI->getCommentColumn());
|
||||||
|
O << MAI->getCommentString()
|
||||||
|
<< FirstName << " significant half of i64 " << Val;
|
||||||
|
}
|
||||||
|
O << '\n';
|
||||||
|
|
||||||
|
O << MAI->getData32bitsDirective(AddrSpace) << SecondChunk;
|
||||||
|
if (VerboseAsm) {
|
||||||
|
O.PadToColumn(MAI->getCommentColumn());
|
||||||
|
O << MAI->getCommentString()
|
||||||
|
<< SecondName << " significant half of i64 " << Val;
|
||||||
|
}
|
||||||
|
O << '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user