summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMichael J. Spencer <bigcheesegs@gmail.com>2013-02-03 10:48:31 +0000
committerMichael J. Spencer <bigcheesegs@gmail.com>2013-02-03 10:48:31 +0000
commitd9d2f187759d0154574657c195068d367c338473 (patch)
tree5b467a7f84e18ccf93fceccc6ed4ef210ea3de94 /include
parentfa987f08fb237e61e4f542572535546d92838b4f (diff)
downloadllvm-d9d2f187759d0154574657c195068d367c338473.tar.gz
llvm-d9d2f187759d0154574657c195068d367c338473.tar.bz2
llvm-d9d2f187759d0154574657c195068d367c338473.tar.xz
[Support] Add LLVM_IS_UNALIGNED_ACCESS_FAST.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174271 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r--include/llvm/Support/Compiler.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/llvm/Support/Compiler.h b/include/llvm/Support/Compiler.h
index 36539f6d34..6ca86bdd50 100644
--- a/include/llvm/Support/Compiler.h
+++ b/include/llvm/Support/Compiler.h
@@ -311,4 +311,17 @@
# define LLVM_MEMORY_SANITIZER_BUILD 0
#endif
+/// \macro LLVM_IS_UNALIGNED_ACCESS_FAST
+/// \brief Is unaligned memory access fast on the host machine.
+///
+/// Don't specialize on alignment for platforms where unaligned memory accesses
+/// generates the same code as aligned memory accesses for common types.
+#if defined(_M_AMD64) || defined(_M_IX86) || defined(__amd64) || \
+ defined(__amd64__) || defined(__x86_64) || defined(__x86_64__) || \
+ defined(_X86_) || defined(__i386) || defined(__i386__)
+# define LLVM_IS_UNALIGNED_ACCESS_FAST 1
+#else
+# define LLVM_IS_UNALIGNED_ACCESS_FAST 0
+#endif
+
#endif