mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-01 12:24:24 +00:00
Fix constant-offset emission for x86-64 absolute addresses. This
fixes a bunch of test-suite JIT failures on x86-64 in -relocation-model=static mode. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58066 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -125,6 +125,42 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
/// emitDWordLE - This callback is invoked when a 64-bit word needs to be
|
||||
/// written to the output stream in little-endian format.
|
||||
///
|
||||
void emitDWordLE(uint64_t W) {
|
||||
if (CurBufferPtr+8 <= BufferEnd) {
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 0);
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 8);
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 16);
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 24);
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 32);
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 40);
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 48);
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 56);
|
||||
} else {
|
||||
CurBufferPtr = BufferEnd;
|
||||
}
|
||||
}
|
||||
|
||||
/// emitDWordBE - This callback is invoked when a 64-bit word needs to be
|
||||
/// written to the output stream in big-endian format.
|
||||
///
|
||||
void emitDWordBE(uint64_t W) {
|
||||
if (CurBufferPtr+8 <= BufferEnd) {
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 56);
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 48);
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 40);
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 32);
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 24);
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 16);
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 8);
|
||||
*CurBufferPtr++ = (unsigned char)(W >> 0);
|
||||
} else {
|
||||
CurBufferPtr = BufferEnd;
|
||||
}
|
||||
}
|
||||
|
||||
/// emitAlignment - Move the CurBufferPtr pointer up the the specified
|
||||
/// alignment (saturated to BufferEnd of course).
|
||||
void emitAlignment(unsigned Alignment) {
|
||||
|
Reference in New Issue
Block a user