aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Lyon <christophe.lyon@st.com>2012-08-31 10:42:41 +0200
committerChristophe Lyon <christophe.lyon@st.com>2012-08-31 10:42:41 +0200
commit87b607e6b4a67ee8e59c8987bb593a5f41fb56b6 (patch)
tree69d81d78df386c7a34736b196fe0a86462af3d4a
parent3ff8c90c92ae9ec1ddf80b22808ff6c149b697c6 (diff)
downloadplatform_external_arm-neon-tests-87b607e6b4a67ee8e59c8987bb593a5f41fb56b6.tar.gz
platform_external_arm-neon-tests-87b607e6b4a67ee8e59c8987bb593a5f41fb56b6.tar.bz2
platform_external_arm-neon-tests-87b607e6b4a67ee8e59c8987bb593a5f41fb56b6.zip
Improve support for endianness of the target processor. (eg when compiling with llvm).
-rw-r--r--stm-arm-neon-ref.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/stm-arm-neon-ref.h b/stm-arm-neon-ref.h
index 7d09a38..e1239e6 100644
--- a/stm-arm-neon-ref.h
+++ b/stm-arm-neon-ref.h
@@ -233,7 +233,21 @@ static void dump_results_hex (const char *test_name)
#ifndef STM_ARM_NEON_MODELS
-#ifndef __BIG_ENDIAN
+/* This hack is to cope with various compilers/libc which may not
+ provide endian.h or cross-compilers such as llvm which includes the
+ host's endian.h. */
+#ifndef __arm__
+#include <endian.h>
+#define THIS_ENDIAN __BYTE_ORDER
+#else /* __arm__ */
+#ifdef __ARMEL__
+#define THIS_ENDIAN __LITTLE_ENDIAN
+#else /* __ARMEL__ */
+#define THIS_ENDIAN __BIG_ENDIAN
+#endif
+#endif /* __arm__ */
+
+#if THIS_ENDIAN == __LITTLE_ENDIAN
typedef union {
struct {