AArch64: use __clear_cache under GCCish environments
authorTim Northover <Tim.Northover@arm.com>
Sat, 4 May 2013 18:52:44 +0000 (18:52 +0000)
committerTim Northover <Tim.Northover@arm.com>
Sat, 4 May 2013 18:52:44 +0000 (18:52 +0000)
AArch64 is going to need some kind of cache-invalidation in order to
successfully JIT since it has a weak memory-model. This is provided by
a __clear_cache builtin in libgcc, which acts very much like the
32-bit ARM equivalent (on platforms where it exists).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181129 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Support/Unix/Memory.inc

index e9b26bdb80f2e36f3c5e5c2e03b2e296321119ab..72a8af621dfcbb4310738dc623c7e5a8a90a8e41 100644 (file)
@@ -325,7 +325,7 @@ void Memory::InvalidateInstructionCache(const void *Addr,
   for (intptr_t Line = StartLine; Line < EndLine; Line += LineSize)
     asm volatile("icbi 0, %0" : : "r"(Line));
   asm volatile("isync");
-#  elif defined(__arm__) && defined(__GNUC__)
+#  elif (defined(__arm__) || defined(__aarch64__)) && defined(__GNUC__)
   // FIXME: Can we safely always call this for __GNUC__ everywhere?
   const char *Start = static_cast<const char *>(Addr);
   const char *End = Start + Len;