Fix clang6 failures.

This commit is contained in:
Antonio Sánchez
2024-10-29 22:18:30 +00:00
committed by Rasmus Munk Larsen
parent 9e962d9c54
commit dd4c2805d9
3 changed files with 13 additions and 7 deletions

View File

@@ -73,8 +73,12 @@ struct cross3_impl<Architecture::Target, VectorLhs, VectorRhs, float, true> {
Packet4f b = rhs_eval.template packet<RhsAlignment, Packet4f>(0);
Packet4f mul1 = pmul(vec4f_swizzle1(a, 1, 2, 0, 3), vec4f_swizzle1(b, 2, 0, 1, 3));
Packet4f mul2 = pmul(vec4f_swizzle1(a, 2, 0, 1, 3), vec4f_swizzle1(b, 1, 2, 0, 3));
a = psub(mul1, mul2);
// Zero-out last component in case of inf/nan.
const __m128i mask = _mm_setr_epi32(0xFFFFFFFF, 0xFFFFFFFF, 0xFFFFFFFF, 0x0);
a = _mm_castsi128_ps(_mm_and_si128(mask, _mm_castps_si128(a)));
DstPlainType res;
pstoret<float, Packet4f, DstAlignment>(&res.x(), psub(mul1, mul2));
pstoret<float, Packet4f, DstAlignment>(res.data(), a);
return res;
}
};