diff options
author | dim <dim@FreeBSD.org> | 2012-12-22 14:58:30 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-12-22 14:58:30 +0000 |
commit | 0ac5f94c68a3d8fbd1380dbba26d891ea7816b5e (patch) | |
tree | c074bb56c422dea536a85cc2d80fd620bb6af08e /lib/Target/Mips/MipsJITInfo.cpp | |
parent | 6de2c08bc400b4aca9fb46684e8bdb56eed9b09f (diff) | |
download | FreeBSD-src-0ac5f94c68a3d8fbd1380dbba26d891ea7816b5e.zip FreeBSD-src-0ac5f94c68a3d8fbd1380dbba26d891ea7816b5e.tar.gz |
Vendor import of llvm tags/RELEASE_32/final r170710 (effectively, 3.2
release):
http://llvm.org/svn/llvm-project/llvm/tags/RELEASE_32/final@170710
Diffstat (limited to 'lib/Target/Mips/MipsJITInfo.cpp')
-rw-r--r-- | lib/Target/Mips/MipsJITInfo.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/Target/Mips/MipsJITInfo.cpp b/lib/Target/Mips/MipsJITInfo.cpp index 052046a..da1119d 100644 --- a/lib/Target/Mips/MipsJITInfo.cpp +++ b/lib/Target/Mips/MipsJITInfo.cpp @@ -222,10 +222,17 @@ void *MipsJITInfo::emitFunctionStub(const Function *F, void *Fn, // addiu t9, t9, %lo(EmittedAddr) // jalr t8, t9 // nop - JCE.emitWordLE(0xf << 26 | 25 << 16 | Hi); - JCE.emitWordLE(9 << 26 | 25 << 21 | 25 << 16 | Lo); - JCE.emitWordLE(25 << 21 | 24 << 11 | 9); - JCE.emitWordLE(0); + if (IsLittleEndian) { + JCE.emitWordLE(0xf << 26 | 25 << 16 | Hi); + JCE.emitWordLE(9 << 26 | 25 << 21 | 25 << 16 | Lo); + JCE.emitWordLE(25 << 21 | 24 << 11 | 9); + JCE.emitWordLE(0); + } else { + JCE.emitWordBE(0xf << 26 | 25 << 16 | Hi); + JCE.emitWordBE(9 << 26 | 25 << 21 | 25 << 16 | Lo); + JCE.emitWordBE(25 << 21 | 24 << 11 | 9); + JCE.emitWordBE(0); + } sys::Memory::InvalidateInstructionCache(Addr, 16); if (!sys::Memory::setRangeExecutable(Addr, 16)) |