diff options
author | Dan Gohman <gohman@apple.com> | 2008-10-24 01:57:54 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-10-24 01:57:54 +0000 |
commit | c9f3cc3bdaf1ec134dec1f718e7f2e735b34b17b (patch) | |
tree | 7b4361c5bfa04942b1cc7e907630bdb793c3e747 /include/llvm/CodeGen/MachineCodeEmitter.h | |
parent | b1e5edc27ec8b41f13d2fcd78e7ff474d8a50b7a (diff) |
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
Diffstat (limited to 'include/llvm/CodeGen/MachineCodeEmitter.h')
-rw-r--r-- | include/llvm/CodeGen/MachineCodeEmitter.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/include/llvm/CodeGen/MachineCodeEmitter.h b/include/llvm/CodeGen/MachineCodeEmitter.h index 4ef230c81b..822fced4cd 100644 --- a/include/llvm/CodeGen/MachineCodeEmitter.h +++ b/include/llvm/CodeGen/MachineCodeEmitter.h @@ -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) { |