sse: prefer SIMDE_SHUFFLE_VECTOR implementation of _mm_shuffle_ps
This makes it a lot easier for the compiler to optimize, and depending
on the value of imm8 it might be able to do much better than the
generic armv7 version, which relies on extracts and inserts.
@@ -3822,6 +3822,16 @@ HEDLEY_DIAGNOSTIC_POP
#if defined(SIMDE_X86_SSE_NATIVE) && !defined(__PGI)
# define simde_mm_shuffle_ps(a, b, imm8) _mm_shuffle_ps(a, b, imm8)
+#elif defined(SIMDE_SHUFFLE_VECTOR_)
+ #define simde_mm_shuffle_ps(a, b, imm8) (__extension__ ({ \
+ simde__m128_from_private((simde__m128_private) { .f32 = \
+ SIMDE_SHUFFLE_VECTOR_(32, 16, \
+ simde__m128_to_private(a).f32, \
+ simde__m128_to_private(b).f32, \
+ (((imm8) ) & 3), \
+ (((imm8) >> 2) & 3), \
+ (((imm8) >> 4) & 3) + 4, \
+ (((imm8) >> 6) & 3) + 4) }); }))
#elif defined(SIMDE_ARM_NEON_A32V7_NATIVE)
#define simde_mm_shuffle_ps(a, b, imm8) \
__extension__({ \
@@ -3838,16 +3848,6 @@ HEDLEY_DIAGNOSTIC_POP
vgetq_lane_f32(b, ((imm8) >> 6) & 0x3), \
ret, 3); \
})
-#elif defined(SIMDE_SHUFFLE_VECTOR_)
-# define simde_mm_shuffle_ps(a, b, imm8) (__extension__ ({ \
- simde__m128_from_private((simde__m128_private) { .f32 = \
- SIMDE_SHUFFLE_VECTOR_(32, 16, \
- simde__m128_to_private(a).f32, \
- simde__m128_to_private(b).f32, \
- (((imm8) ) & 3), \
- (((imm8) >> 2) & 3), \
- (((imm8) >> 4) & 3) + 4, \
- (((imm8) >> 6) & 3) + 4) }); }))
#else
SIMDE_FUNCTION_ATTRIBUTES
simde__m128
