mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
Next PPC long double bits. First cut at constants.
No compile-time support for constant operations yet, just format transformations. Make readers and writers work. Split constants into 2 doubles in Legalize. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42865 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -519,6 +519,8 @@ static void WriteConstantInt(std::ostream &Out, const Constant *CV,
|
||||
Out << 'K';
|
||||
else if (&CFP->getValueAPF().getSemantics() == &APFloat::IEEEquad)
|
||||
Out << 'L';
|
||||
else if (&CFP->getValueAPF().getSemantics() == &APFloat::PPCDoubleDouble)
|
||||
Out << 'M';
|
||||
else
|
||||
assert(0 && "Unsupported floating point type");
|
||||
// api needed to prevent premature destruction
|
||||
@@ -526,7 +528,7 @@ static void WriteConstantInt(std::ostream &Out, const Constant *CV,
|
||||
const uint64_t* p = api.getRawData();
|
||||
uint64_t word = *p;
|
||||
int shiftcount=60;
|
||||
int width = CFP->getValueAPF().convertToAPInt().getBitWidth();
|
||||
int width = api.getBitWidth();
|
||||
for (int j=0; j<width; j+=4, shiftcount-=4) {
|
||||
unsigned int nibble = (word>>shiftcount) & 15;
|
||||
if (nibble < 10)
|
||||
@@ -535,7 +537,7 @@ static void WriteConstantInt(std::ostream &Out, const Constant *CV,
|
||||
Out << (unsigned char)(nibble - 10 + 'A');
|
||||
if (shiftcount == 0) {
|
||||
word = *(++p);
|
||||
shiftcount = 60;
|
||||
shiftcount = 64;
|
||||
if (width-j-4 < 64)
|
||||
shiftcount = width-j-4;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user