Force vector pairs in clang.

This commit is contained in:
Chip Kerchner 2024-09-23 08:43:58 -05:00
parent 89a12fa083
commit c9ce37d527
1 changed files with 8 additions and 0 deletions

View File

@ -46,7 +46,11 @@ FORCEINLINE void vec_load_pair(vec_f32 *dst, vec_f32 *src)
{ {
#ifdef USE_VECTOR_PAIRS #ifdef USE_VECTOR_PAIRS
__vector_pair vy0p; __vector_pair vy0p;
#ifdef __clang__
vy0p = __builtin_vsx_lxvp(0L, (const __vector_pair *)(src));
#else
vy0p = *(__vector_pair *)(src); vy0p = *(__vector_pair *)(src);
#endif
__builtin_vsx_disassemble_pair((void *)(dst), &vy0p); __builtin_vsx_disassemble_pair((void *)(dst), &vy0p);
#else #else
dst[0] = src[0]; dst[0] = src[0];
@ -59,7 +63,11 @@ FORCEINLINE void vec_store_pair(vec_f32 *dst, vec_f32 *src)
#ifdef USE_VECTOR_PAIRS #ifdef USE_VECTOR_PAIRS
__vector_pair vy0p; __vector_pair vy0p;
__builtin_vsx_assemble_pair2(&vy0p, (vec_uc8)src[1], (vec_uc8)src[0]); __builtin_vsx_assemble_pair2(&vy0p, (vec_uc8)src[1], (vec_uc8)src[0]);
#ifdef __clang__
__builtin_vsx_stxvp(vy0p, 0L, (__vector_pair *)(dst));
#else
*(__vector_pair *)(dst) = vy0p; *(__vector_pair *)(dst) = vy0p;
#endif
#else #else
dst[0] = src[0]; dst[0] = src[0];
dst[1] = src[1]; dst[1] = src[1];