Commit a686efde authored by Michael R. Crusoe's avatar Michael R. Crusoe Committed by Michael R. Crusoe

x86 sse4.1 mm_testz_si128: fix backwards short circuit logic

Co-authored-by: default avatarFlorent Hivert <Florent.Hivert@lri.fr>
parent bc206e4f
...@@ -2340,14 +2340,19 @@ simde_mm_testz_si128 (simde__m128i a, simde__m128i b) { ...@@ -2340,14 +2340,19 @@ simde_mm_testz_si128 (simde__m128i a, simde__m128i b) {
#elif defined(SIMDE_WASM_SIMD128_NATIVE) #elif defined(SIMDE_WASM_SIMD128_NATIVE)
v128_t m = wasm_v128_and(a_.wasm_v128, b_.wasm_v128); v128_t m = wasm_v128_and(a_.wasm_v128, b_.wasm_v128);
return (wasm_i64x2_extract_lane(m, 0) | wasm_i64x2_extract_lane(m, 1)) == 0; return (wasm_i64x2_extract_lane(m, 0) | wasm_i64x2_extract_lane(m, 1)) == 0;
#elif defined(SIMDE_HAVE_INT128_)
if ((a_.u128[0] & b_.u128[0]) == 0) {
return 1;
}
return 0;
#else #else
for (size_t i = 0 ; i < (sizeof(a_.u64) / sizeof(a_.u64[0])) ; i++) { for (size_t i = 0 ; i < (sizeof(a_.u64) / sizeof(a_.u64[0])) ; i++) {
if ((a_.u64[i] & b_.u64[i]) == 0) if ((a_.u64[i] & b_.u64[i]) > 0)
return 1; return 0;
} }
#endif #endif
return 0; return 1;
#endif #endif
} }
#if defined(SIMDE_X86_SSE4_1_ENABLE_NATIVE_ALIASES) #if defined(SIMDE_X86_SSE4_1_ENABLE_NATIVE_ALIASES)
......
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