Skip to content

Commit ecd4e8e

Browse files
committed
ARM: Fix signed/unsigned simd mismatch in vbool4::load
Fixes 3721 Please read the comments in 3721. This is the "local" fix for the build break due to the type mismatch. It is a band-aid. And it may be the best solution for the 2.4 branch if we don't want to potentially break ABIs by changing the definition of any public types. Still pending is to examine the issue of whether it was a mistake to define vbool4 storage for neon as uint32x4_t or if we should change it to int32x4_t to better match the non-simd reference implementation. After debating that (and identifying somebody with access to an ARM-based machine to test the solution for us), we may return to tackle this more fundamental change.
1 parent fc2c261 commit ecd4e8e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/include/OpenImageIO/simd.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3261,7 +3261,9 @@ OIIO_FORCEINLINE void vbool4::load (bool a, bool b, bool c, bool d) {
32613261
m_simd = _mm_castsi128_ps(_mm_set_epi32(-int(d), -int(c), -int(b), -int(a)));
32623262
#elif OIIO_SIMD_NEON
32633263
int values[4] = { -int(a), -int(b), -int(c), -int(d) };
3264-
m_simd = vld1q_s32 (values);
3264+
m_simd = vld1q_u32((const uint32_t*)values);
3265+
// this if we were using int:
3266+
// m_simd = vld1q_s32(values);
32653267
#else
32663268
m_val[0] = -int(a);
32673269
m_val[1] = -int(b);

0 commit comments

Comments
 (0)