--- /dev/null
+Description: libpremnotify-cpu: Guard architecture dependent code with #ifdefs
+ This allows compiling "placeholder" version of the library for other
+ architecures.
+ .
+Author: Michal Sojka <michal.sojka@cvut.cz>
+
+---
+The information above should follow the Patch Tagging Guidelines, please
+checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here
+are templates for supplementary fields that you might want to add:
+
+Origin: <vendor|upstream|other>, <url of original patch>
+Bug: <url in upstream bugtracker>
+Bug-Debian: https://bugs.debian.org/<bugnumber>
+Bug-Ubuntu: https://launchpad.net/bugs/<bugnumber>
+Forwarded: <no|not-needed|url proving that it has been forwarded>
+Reviewed-By: <name and email of someone who approved the patch>
+Last-Update: 2018-09-04
+
+--- hercules-compiler-2018.7.orig/HerculesCompiler/libpremnotify/libpremnotify-cpu.c
++++ hercules-compiler-2018.7/HerculesCompiler/libpremnotify/libpremnotify-cpu.c
+@@ -44,13 +44,17 @@ void __hw_data_cache_flush_stub() {
+
+ }
+
+-void __prem_prefetch(void * ptr, int isRead) {
++void __prem_prefetch(void * ptr, int isRead) {
++#if defined(__aarch64__)
+ if(isRead)
+ __asm__ __volatile__("prfm pldl2keep, %a0\n" : : "p" (ptr));
+ else
+- __asm__ __volatile__("prfm pstl2keep, %a0\n" : : "p" (ptr));
++ __asm__ __volatile__("prfm pstl2keep, %a0\n" : : "p" (ptr));
++#endif
+ }
+
+ void __prem_evict(void * ptr) {
++#if defined(__aarch64__)
+ __asm__ __volatile__("dc civac, %0\n" : : "r" (ptr) : "memory");
++#endif
+ }
===================================================================
--- hercules-compiler.orig/HerculesCompiler/llvm-passes/include/Config/Options.h
+++ hercules-compiler/HerculesCompiler/llvm-passes/include/Config/Options.h
-@@ -41,11 +41,11 @@
+@@ -41,17 +41,17 @@
//#define NEVER_INLINE_SYNC
// Use hardware cache prefetches in Specialized function, in place of SPM-based.
//#define USE_HW_CACHES_INLINEPTX_PREFETCH
//#define USE_HW_CACHES_LIBCALL
//#define USE_HW_CACHES_VOLALOAD
+
+ // Use a single writeback function when using caches
+-//#define USE_HW_CACHES_SINGLEWRITEBACK
++#define USE_HW_CACHES_SINGLEWRITEBACK
+ //#define USE_HW_CACHES_INDWRITEBACK_LIBCALL
+ //#define USE_HW_CACHES_INDWRITEBACK_INLINE
+
Index: hercules-compiler/clang/lib/Driver/ToolChains.cpp
===================================================================
--- hercules-compiler.orig/clang/lib/Driver/ToolChains.cpp