summaryrefslogtreecommitdiff
path: root/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
diff options
context:
space:
mode:
authorTim Northover <Tim.Northover@arm.com>2013-05-04 20:14:09 +0000
committerTim Northover <Tim.Northover@arm.com>2013-05-04 20:14:09 +0000
commit4a9b6b798d5ea335f5f29d278db83b830ae4a564 (patch)
tree5ee232d04df00a2f62837892d5d400addf0d578a /lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
parent654c2d6b7a9274fc281c30c0e91419aadb6dc78a (diff)
downloadllvm-4a9b6b798d5ea335f5f29d278db83b830ae4a564.tar.gz
llvm-4a9b6b798d5ea335f5f29d278db83b830ae4a564.tar.bz2
llvm-4a9b6b798d5ea335f5f29d278db83b830ae4a564.tar.xz
AArch64: add stubs to support long function calls on MCJIT
As with global accesses, external functions could exist anywhere in memory. Therefore the stub must create a complete 64-bit address. This patch implements the fragment as (roughly): movz x16, #:abs_g3:somefunc movk x16, #:abs_g2_nc:somefunc movk x16, #:abs_g1_nc:somefunc movk x16, #:abs_g0_nc:somefunc br x16 In principle we could save 4 bytes by using a literal-load instead, but it is unclear that would be more efficient and can only be tested when real hardware is readily available. This allows (for example) the MCJIT test 2003-05-07-ArgumentTest to pass on AArch64. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181133 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h')
-rw-r--r--lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
index 9d767a067c..b09e71ed4b 100644
--- a/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
+++ b/lib/ExecutionEngine/RuntimeDyld/RuntimeDyldImpl.h
@@ -166,6 +166,8 @@ protected:
Triple::ArchType Arch;
inline unsigned getMaxStubSize() {
+ if (Arch == Triple::aarch64)
+ return 20; // movz; movk; movk; movk; br
if (Arch == Triple::arm || Arch == Triple::thumb)
return 8; // 32-bit instruction and 32-bit address
else if (Arch == Triple::mipsel || Arch == Triple::mips)