Commit 5b07b50c authored by Evan Nemerson's avatar Evan Nemerson

Lots of fixes for native aliases on Arm.

parent 0eb9e26e
...@@ -67,7 +67,7 @@ simde_vdot_s32(simde_int32x2_t r, simde_int8x8_t a, simde_int8x8_t b) { ...@@ -67,7 +67,7 @@ simde_vdot_s32(simde_int32x2_t r, simde_int8x8_t a, simde_int8x8_t b) {
return simde_vadd_s32(r, simde_int32x2_from_private(r_)); return simde_vadd_s32(r, simde_int32x2_from_private(r_));
#endif #endif
} }
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) #if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_DOTPROD))
#undef vdot_s32 #undef vdot_s32
#define vdot_s32(r, a, b) simde_vdot_s32((r), (a), (b)) #define vdot_s32(r, a, b) simde_vdot_s32((r), (a), (b))
#endif #endif
...@@ -97,7 +97,7 @@ simde_vdot_u32(simde_uint32x2_t r, simde_uint8x8_t a, simde_uint8x8_t b) { ...@@ -97,7 +97,7 @@ simde_vdot_u32(simde_uint32x2_t r, simde_uint8x8_t a, simde_uint8x8_t b) {
return simde_vadd_u32(r, simde_uint32x2_from_private(r_)); return simde_vadd_u32(r, simde_uint32x2_from_private(r_));
#endif #endif
} }
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) #if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_DOTPROD))
#undef vdot_u32 #undef vdot_u32
#define vdot_u32(r, a, b) simde_vdot_u32((r), (a), (b)) #define vdot_u32(r, a, b) simde_vdot_u32((r), (a), (b))
#endif #endif
...@@ -128,7 +128,7 @@ simde_vdotq_s32(simde_int32x4_t r, simde_int8x16_t a, simde_int8x16_t b) { ...@@ -128,7 +128,7 @@ simde_vdotq_s32(simde_int32x4_t r, simde_int8x16_t a, simde_int8x16_t b) {
return simde_vaddq_s32(r, simde_int32x4_from_private(r_)); return simde_vaddq_s32(r, simde_int32x4_from_private(r_));
#endif #endif
} }
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) #if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_DOTPROD))
#undef vdotq_s32 #undef vdotq_s32
#define vdotq_s32(r, a, b) simde_vdotq_s32((r), (a), (b)) #define vdotq_s32(r, a, b) simde_vdotq_s32((r), (a), (b))
#endif #endif
...@@ -159,7 +159,7 @@ simde_vdotq_u32(simde_uint32x4_t r, simde_uint8x16_t a, simde_uint8x16_t b) { ...@@ -159,7 +159,7 @@ simde_vdotq_u32(simde_uint32x4_t r, simde_uint8x16_t a, simde_uint8x16_t b) {
return simde_vaddq_u32(r, simde_uint32x4_from_private(r_)); return simde_vaddq_u32(r, simde_uint32x4_from_private(r_));
#endif #endif
} }
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) #if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_DOTPROD))
#undef vdotq_u32 #undef vdotq_u32
#define vdotq_u32(r, a, b) simde_vdotq_u32((r), (a), (b)) #define vdotq_u32(r, a, b) simde_vdotq_u32((r), (a), (b))
#endif #endif
......
...@@ -74,7 +74,7 @@ simde_vdot_lane_s32(simde_int32x2_t r, simde_int8x8_t a, simde_int8x8_t b, const ...@@ -74,7 +74,7 @@ simde_vdot_lane_s32(simde_int32x2_t r, simde_int8x8_t a, simde_int8x8_t b, const
#endif #endif
return result; return result;
} }
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) #if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_DOTPROD))
#undef vdot_lane_s32 #undef vdot_lane_s32
#define vdot_lane_s32(r, a, b, lane) simde_vdot_lane_s32((r), (a), (b), (lane)) #define vdot_lane_s32(r, a, b, lane) simde_vdot_lane_s32((r), (a), (b), (lane))
#endif #endif
...@@ -110,7 +110,7 @@ simde_vdot_lane_u32(simde_uint32x2_t r, simde_uint8x8_t a, simde_uint8x8_t b, co ...@@ -110,7 +110,7 @@ simde_vdot_lane_u32(simde_uint32x2_t r, simde_uint8x8_t a, simde_uint8x8_t b, co
#endif #endif
return result; return result;
} }
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) #if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_DOTPROD))
#undef vdot_lane_u32 #undef vdot_lane_u32
#define vdot_lane_u32(r, a, b, lane) simde_vdot_lane_u32((r), (a), (b), (lane)) #define vdot_lane_u32(r, a, b, lane) simde_vdot_lane_u32((r), (a), (b), (lane))
#endif #endif
...@@ -147,7 +147,7 @@ simde_vdot_laneq_s32(simde_int32x4_t r, simde_int8x16_t a, simde_int8x16_t b, co ...@@ -147,7 +147,7 @@ simde_vdot_laneq_s32(simde_int32x4_t r, simde_int8x16_t a, simde_int8x16_t b, co
#endif #endif
return result; return result;
} }
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) #if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_DOTPROD))
#undef vdot_laneq_s32 #undef vdot_laneq_s32
#define vdot_laneq_s32(r, a, b, lane) simde_vdot_laneq_s32((r), (a), (b), (lane)) #define vdot_laneq_s32(r, a, b, lane) simde_vdot_laneq_s32((r), (a), (b), (lane))
#endif #endif
...@@ -184,7 +184,7 @@ simde_vdot_laneq_u32(simde_uint32x4_t r, simde_uint8x16_t a, simde_uint8x16_t b, ...@@ -184,7 +184,7 @@ simde_vdot_laneq_u32(simde_uint32x4_t r, simde_uint8x16_t a, simde_uint8x16_t b,
#endif #endif
return result; return result;
} }
#if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) #if defined(SIMDE_ARM_NEON_A32V8_ENABLE_NATIVE_ALIASES) || (defined(SIMDE_ENABLE_NATIVE_ALIASES) && !defined(__ARM_FEATURE_DOTPROD))
#undef vdot_laneq_u32 #undef vdot_laneq_u32
#define vdot_laneq_u32(r, a, b, lane) simde_vdot_laneq_u32((r), (a), (b), (lane)) #define vdot_laneq_u32(r, a, b, lane) simde_vdot_laneq_u32((r), (a), (b), (lane))
#endif #endif
......
...@@ -181,7 +181,10 @@ ...@@ -181,7 +181,10 @@
* before we can access certain SIMD intrinsics, but this diagnostic * before we can access certain SIMD intrinsics, but this diagnostic
* warns about it being a reserved name. It is a reserved name, but * warns about it being a reserved name. It is a reserved name, but
* it's reserved for the compiler and we are using it to convey * it's reserved for the compiler and we are using it to convey
* information to the compiler. */ * information to the compiler.
*
* This is also used when enabling native aliases since we don't get to
* choose the macro names. */
#if HEDLEY_HAS_WARNING("-Wdouble-promotion") #if HEDLEY_HAS_WARNING("-Wdouble-promotion")
#define SIMDE_DIAGNOSTIC_DISABLE_RESERVED_ID_MACRO_ _Pragma("clang diagnostic ignored \"-Wreserved-id-macro\"") #define SIMDE_DIAGNOSTIC_DISABLE_RESERVED_ID_MACRO_ _Pragma("clang diagnostic ignored \"-Wreserved-id-macro\"")
#else #else
...@@ -377,7 +380,15 @@ ...@@ -377,7 +380,15 @@
#define SIMDE_DIAGNOSTIC_DISABLE_MAYBE_UNINITIAZILED_ #define SIMDE_DIAGNOSTIC_DISABLE_MAYBE_UNINITIAZILED_
#endif #endif
#if defined(SIMDE_ENABLE_NATIVE_ALIASES)
#define SIMDE_DISABLE_UNWANTED_DIAGNOSTICS_NATIVE_ALIASES_ \
SIMDE_DIAGNOSTIC_DISABLE_RESERVED_ID_MACRO_
#else
#define SIMDE_DISABLE_UNWANTED_DIAGNOSTICS_NATIVE_ALIASES_
#endif
#define SIMDE_DISABLE_UNWANTED_DIAGNOSTICS \ #define SIMDE_DISABLE_UNWANTED_DIAGNOSTICS \
SIMDE_DISABLE_UNWANTED_DIAGNOSTICS_NATIVE_ALIASES_ \
SIMDE_DIAGNOSTIC_DISABLE_PSABI_ \ SIMDE_DIAGNOSTIC_DISABLE_PSABI_ \
SIMDE_DIAGNOSTIC_DISABLE_NO_EMMS_INSTRUCTION_ \ SIMDE_DIAGNOSTIC_DISABLE_NO_EMMS_INSTRUCTION_ \
SIMDE_DIAGNOSTIC_DISABLE_SIMD_PRAGMA_DEPRECATED_ \ SIMDE_DIAGNOSTIC_DISABLE_SIMD_PRAGMA_DEPRECATED_ \
......
...@@ -2479,7 +2479,11 @@ simde_mm_loadh_pi (simde__m128 a, simde__m64 const* mem_addr) { ...@@ -2479,7 +2479,11 @@ simde_mm_loadh_pi (simde__m128 a, simde__m64 const* mem_addr) {
#endif #endif
} }
#if defined(SIMDE_X86_SSE_ENABLE_NATIVE_ALIASES) #if defined(SIMDE_X86_SSE_ENABLE_NATIVE_ALIASES)
# define _mm_loadh_pi(a, mem_addr) simde_mm_loadh_pi((a), (simde__m64 const*) (mem_addr)) #if HEDLEY_HAS_WARNING("-Wold-style-cast")
#define _mm_loadh_pi(a, mem_addr) simde_mm_loadh_pi((a), HEDLEY_REINTERPRET_CAST(simde__m64 const*, (mem_addr)))
#else
#define _mm_loadh_pi(a, mem_addr) simde_mm_loadh_pi((a), (simde__m64 const*) (mem_addr))
#endif
#endif #endif
/* The SSE documentation says that there are no alignment requirements /* The SSE documentation says that there are no alignment requirements
...@@ -2517,7 +2521,11 @@ simde_mm_loadl_pi (simde__m128 a, simde__m64 const* mem_addr) { ...@@ -2517,7 +2521,11 @@ simde_mm_loadl_pi (simde__m128 a, simde__m64 const* mem_addr) {
#endif #endif
} }
#if defined(SIMDE_X86_SSE_ENABLE_NATIVE_ALIASES) #if defined(SIMDE_X86_SSE_ENABLE_NATIVE_ALIASES)
# define _mm_loadl_pi(a, mem_addr) simde_mm_loadl_pi((a), (simde__m64 const*) (mem_addr)) #if HEDLEY_HAS_WARNING("-Wold-style-cast")
#define _mm_loadl_pi(a, mem_addr) simde_mm_loadl_pi((a), HEDLEY_REINTERPRET_CAST(simde__m64 const*, (mem_addr)))
#else
#define _mm_loadl_pi(a, mem_addr) simde_mm_loadl_pi((a), (simde__m64 const*) (mem_addr))
#endif
#endif #endif
SIMDE_FUNCTION_ATTRIBUTES SIMDE_FUNCTION_ATTRIBUTES
......
...@@ -5243,7 +5243,7 @@ simde_mm_shufflelo_epi16 (simde__m128i a, const int imm8) ...@@ -5243,7 +5243,7 @@ simde_mm_shufflelo_epi16 (simde__m128i a, const int imm8)
#if defined(SIMDE_X86_SSE2_NATIVE) #if defined(SIMDE_X86_SSE2_NATIVE)
#define simde_mm_shufflelo_epi16(a, imm8) _mm_shufflelo_epi16((a), (imm8)) #define simde_mm_shufflelo_epi16(a, imm8) _mm_shufflelo_epi16((a), (imm8))
#elif defined(SIMDE_ARM_NEON_A32V7_NATIVE) #elif defined(SIMDE_ARM_NEON_A32V7_NATIVE)
#define _mm_shufflelo_epi16(a, imm8) \ #define simde_mm_shufflelo_epi16(a, imm8) \
__extension__({ \ __extension__({ \
int16x8_t ret = vreinterpretq_s16_s64(a); \ int16x8_t ret = vreinterpretq_s16_s64(a); \
int16x4_t lowBits = vget_low_s16(ret); \ int16x4_t lowBits = vget_low_s16(ret); \
......
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