rs6000 Power10BE: Fix _mm_movemask intrinsics byte order
Big-endian Power10's SSE movemask intrinsics now produce correct masks by reversing vector element order.
On big-endian Power10 systems, the SSE _mm_movemask intrinsics produced masks with bits in an incorrect order due to the native vector element ordering. This change reverses the vector element order using vec_reve() before calling vec_extractm(), ensuring that the generated masks match the expected SSE behavior on both big and little-endian targets.
In Details
The _mm_movemask_pd, _mm_movemask_ps, and _mm_movemask_epi8 intrinsics on big-endian Power10 are implemented using vec_extractm. However, the native vector element order on big-endian systems causes vec_extractm to produce mask bits in reverse order compared to the SSE specification. This commit inserts a vec_reve() call to reverse the vector element order prior to vec_extractm, correcting the mask generation for these SSE intrinsics on big-endian Power10.
- intrinsics
- Functions that provide a way to access specific hardware instructions or features directly from high-level code, often for performance optimization.
- _mm_movemask_pd
- An SSE intrinsic that creates a mask from the most significant bits of packed double-precision floating-point elements.
- _mm_movemask_ps
- An SSE intrinsic that creates a mask from the most significant bits of packed single-precision floating-point elements.
- _mm_movemask_epi8
- An SSE intrinsic that creates a mask from the most significant bits of packed 8-bit integer elements.
- big-endian
- A computer architecture where the most significant byte of a multi-byte word is stored at the lowest memory address.
- little-endian
- A computer architecture where the least significant byte of a multi-byte word is stored at the lowest memory address.
- vec_extractm
- A PowerPC vector intrinsic that extracts multiple elements from a vector based on a mask.
- vec_reve
- A PowerPC vector intrinsic that reverses the order of elements within a vector.