diff options
author | Christophe Lyon <christophe.lyon@st.com> | 2012-08-31 10:42:41 +0200 |
---|---|---|
committer | Christophe Lyon <christophe.lyon@st.com> | 2012-08-31 10:42:41 +0200 |
commit | 87b607e6b4a67ee8e59c8987bb593a5f41fb56b6 (patch) | |
tree | 69d81d78df386c7a34736b196fe0a86462af3d4a /stm-arm-neon-ref.h | |
parent | 3ff8c90c92ae9ec1ddf80b22808ff6c149b697c6 (diff) | |
download | platform_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).
Diffstat (limited to 'stm-arm-neon-ref.h')
-rw-r--r-- | stm-arm-neon-ref.h | 16 |
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 { |