sse4.1: add NEON implementation of mm_test{nzc_si128,mix_ones_zeros}
@@ -1902,12 +1902,18 @@ simde_mm_test_mix_ones_zeros (simde__m128i a, simde__m128i mask) {
a_ = simde__m128i_to_private(a),
mask_ = simde__m128i_to_private(mask);
+ #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
+ int64x2_t s640 = vandq_s64(a_.neon_i64, mask_.neon_i64);
+ int64x2_t s641 = vandq_s64(~a_.neon_i64, mask_.neon_i64);
+ return (((vgetq_lane_s64(s640, 0) | vgetq_lane_s64(s640, 1)) & (vgetq_lane_s64(s641, 0) | vgetq_lane_s64(s641, 1)))!=0);
+ #else
for (size_t i = 0 ; i < (sizeof(a_.u64) / sizeof(a_.u64[0])) ; i++)
if (((a_.u64[i] & mask_.u64[i]) != 0) && ((~a_.u64[i] & mask_.u64[i]) != 0))
return 1;
return 0;
#endif
+#endif
}
#if defined(SIMDE_X86_SSE4_1_ENABLE_NATIVE_ALIASES)
#undef _mm_test_mix_ones_zeros
@@ -1954,6 +1960,11 @@ simde_mm_testnzc_si128 (simde__m128i a, simde__m128i b) {
a_ = simde__m128i_to_private(a),
b_ = simde__m128i_to_private(b);
+ #if defined(SIMDE_ARM_NEON_A32V7_NATIVE)
+ int64x2_t s640 = vandq_s64(a_.neon_i64, b_.neon_i64);
+ int64x2_t s641 = vandq_s64(~a_.neon_i64, b_.neon_i64);
+ return (((vgetq_lane_s64(s640, 0) | vgetq_lane_s64(s640, 1)) & (vgetq_lane_s64(s641, 0) | vgetq_lane_s64(s641, 1)))!=0);
+ #else
for (size_t i = 0 ; i < (sizeof(a_.u64) / sizeof(a_.u64[0])) ; i++) {
if (((a_.u64[i] & b_.u64[i]) != 0) && ((~a_.u64[i] & b_.u64[i]) != 0))
return 1;
@@ -1961,6 +1972,7 @@ simde_mm_testnzc_si128 (simde__m128i a, simde__m128i b) {
return 0;
#endif
+#endif
}
#if defined(SIMDE_X86_SSE4_1_ENABLE_NATIVE_ALIASES)
#undef _mm_testnzc_si128
