Commit fa16041c authored by Alex Converse's avatar Alex Converse
Browse files

Fix Wundef errors in simd intrinsics

Change-Id: I551eda906c96fac77125e10e6f71e9a6edca5baf
parent 7a71d0a0
...@@ -54,7 +54,7 @@ SIMD_INLINE void v128_store_unaligned(void *p, v128 r) { ...@@ -54,7 +54,7 @@ SIMD_INLINE void v128_store_unaligned(void *p, v128 r) {
SIMD_INLINE v128 v128_align(v128 a, v128 b, const unsigned int c) { SIMD_INLINE v128 v128_align(v128 a, v128 b, const unsigned int c) {
// The following functions require an immediate. // The following functions require an immediate.
// Some compilers will check this during optimisation, others wont. // Some compilers will check this during optimisation, others wont.
#if __OPTIMIZE__ && !__clang__ #if defined(__OPTIMIZE__) && __OPTIMIZE__ && !defined(__clang__)
return c ? vreinterpretq_s64_s8( return c ? vreinterpretq_s64_s8(
vextq_s8(vreinterpretq_s8_s64(b), vreinterpretq_s8_s64(a), c)) vextq_s8(vreinterpretq_s8_s64(b), vreinterpretq_s8_s64(a), c))
: b; : b;
...@@ -518,7 +518,7 @@ SIMD_INLINE v128 v128_shr_s32(v128 a, unsigned int c) { ...@@ -518,7 +518,7 @@ SIMD_INLINE v128 v128_shr_s32(v128 a, unsigned int c) {
vshlq_s32(vreinterpretq_s32_s64(a), vdupq_n_s32(-c))); vshlq_s32(vreinterpretq_s32_s64(a), vdupq_n_s32(-c)));
} }
#if __OPTIMIZE__ && !__clang__ #if defined(__OPTIMIZE__) && __OPTIMIZE__ && !defined(__clang__)
SIMD_INLINE v128 v128_shl_n_byte(v128 a, const unsigned int n) { SIMD_INLINE v128 v128_shl_n_byte(v128 a, const unsigned int n) {
return n < 8 return n < 8
......
...@@ -60,7 +60,7 @@ SIMD_INLINE void v128_store_unaligned(void *p, v128 a) { ...@@ -60,7 +60,7 @@ SIMD_INLINE void v128_store_unaligned(void *p, v128 a) {
// The following function requires an immediate. // The following function requires an immediate.
// Some compilers will check this during optimisation, others wont. // Some compilers will check this during optimisation, others wont.
#if __OPTIMIZE__ && !__clang__ #if defined(__OPTIMIZE__) && __OPTIMIZE__ && !defined(__clang__)
#if defined(__SSSE3__) #if defined(__SSSE3__)
SIMD_INLINE v128 v128_align(v128 a, v128 b, const unsigned int c) { SIMD_INLINE v128 v128_align(v128 a, v128 b, const unsigned int c) {
return c ? _mm_alignr_epi8(a, b, c) : b; return c ? _mm_alignr_epi8(a, b, c) : b;
......
...@@ -20,8 +20,8 @@ ...@@ -20,8 +20,8 @@
// The _m256i type seems to cause problems for g++'s mangling prior to // The _m256i type seems to cause problems for g++'s mangling prior to
// version 5, but adding -fabi-version=0 fixes this. // version 5, but adding -fabi-version=0 fixes this.
#if !defined(__clang__) && __GNUC__ < 5 && defined(__AVX2__) && \ #if !defined(__clang__) && defined(__GNUC__) && __GNUC__ < 5 && \
defined(__cplusplus) defined(__AVX2__) && defined(__cplusplus)
#pragma GCC optimize "-fabi-version=0" #pragma GCC optimize "-fabi-version=0"
#endif #endif
......
...@@ -64,12 +64,12 @@ SIMD_INLINE void u32_store_aligned(void *p, uint32_t a) { ...@@ -64,12 +64,12 @@ SIMD_INLINE void u32_store_aligned(void *p, uint32_t a) {
} }
SIMD_INLINE void u32_store_unaligned(void *p, uint32_t a) { SIMD_INLINE void u32_store_unaligned(void *p, uint32_t a) {
#if __clang__ #if defined(__clang__)
vst1_lane_u32((uint32_t *)p, vreinterpret_u32_s64((uint64x1_t)(uint64_t)a), vst1_lane_u32((uint32_t *)p, vreinterpret_u32_s64((uint64x1_t)(uint64_t)a),
0); 0);
#elif __CC_ARM #elif defined(__CC_ARM)
*(__packed uint32_t *)p) = a; *(__packed uint32_t *)p) = a;
#elif __GNUC__ #elif defined(__GNUC__)
*((__attribute((packed)) uint32_t *)p) = a; *((__attribute((packed)) uint32_t *)p) = a;
#else #else
vst1_lane_u32((uint32_t *)p, vreinterpret_u32_s64((uint64x1_t)(uint64_t)a), vst1_lane_u32((uint32_t *)p, vreinterpret_u32_s64((uint64x1_t)(uint64_t)a),
...@@ -96,7 +96,7 @@ SIMD_INLINE void v64_store_unaligned(void *p, v64 r) { ...@@ -96,7 +96,7 @@ SIMD_INLINE void v64_store_unaligned(void *p, v64 r) {
// The following function requires an immediate. // The following function requires an immediate.
// Some compilers will check this if it's optimising, others wont. // Some compilers will check this if it's optimising, others wont.
SIMD_INLINE v64 v64_align(v64 a, v64 b, const unsigned int c) { SIMD_INLINE v64 v64_align(v64 a, v64 b, const unsigned int c) {
#if __OPTIMIZE__ && !__clang__ #if defined(__OPTIMIZE__) && __OPTIMIZE__ && !defined(__clang__)
return c ? vreinterpret_s64_s8( return c ? vreinterpret_s64_s8(
vext_s8(vreinterpret_s8_s64(b), vreinterpret_s8_s64(a), c)) vext_s8(vreinterpret_s8_s64(b), vreinterpret_s8_s64(a), c))
: b; : b;
...@@ -479,7 +479,7 @@ SIMD_INLINE v64 v64_shr_s32(v64 a, unsigned int c) { ...@@ -479,7 +479,7 @@ SIMD_INLINE v64 v64_shr_s32(v64 a, unsigned int c) {
// The following functions require an immediate. // The following functions require an immediate.
// Some compilers will check this during optimisation, others wont. // Some compilers will check this during optimisation, others wont.
#if __OPTIMIZE__ && !__clang__ #if defined(__OPTIMIZE__) && __OPTIMIZE__ && !defined(__clang__)
SIMD_INLINE v64 v64_shl_n_byte(v64 a, const unsigned int c) { SIMD_INLINE v64 v64_shl_n_byte(v64 a, const unsigned int c) {
return vshl_n_s64(a, c * 8); return vshl_n_s64(a, c * 8);
......
...@@ -91,7 +91,7 @@ SIMD_INLINE void v64_store_unaligned(void *p, v64 a) { ...@@ -91,7 +91,7 @@ SIMD_INLINE void v64_store_unaligned(void *p, v64 a) {
} }
// The following function requires an immediate. // The following function requires an immediate.
#if __OPTIMIZE__ #if defined(__OPTIMIZE__) && __OPTIMIZE__
#define v64_align(a, b, c) \ #define v64_align(a, b, c) \
((c) ? _mm_srli_si128(_mm_unpacklo_epi64(b, a), (c)) : b) ((c) ? _mm_srli_si128(_mm_unpacklo_epi64(b, a), (c)) : b)
#else #else
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment