From: Segher Boessenkool Date: Sat, 23 Mar 2019 16:15:48 +0000 (+0100) Subject: rs6000: Fix _mm_movemask_pi8 emulation for 32 bit X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=8ab1df52336656b35195efacaa34150a2ac33497;p=gcc.git rs6000: Fix _mm_movemask_pi8 emulation for 32 bit * config/rs6000/xmmintrin.h (_mm_movemask_pi8): Implement for 32-bit big endian. From-SVN: r269891 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 14977c95187..6b9f1c4a2b6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2019-03-23 Segher Boessenkool + + * config/rs6000/xmmintrin.h (_mm_movemask_pi8): Implement for 32-bit + big endian. + 2019-03-22 Andrew Pinski * config/aarch64/aarch64.md (zero_extendsidi2_aarch64): Fix type diff --git a/gcc/config/rs6000/xmmintrin.h b/gcc/config/rs6000/xmmintrin.h index 71e4bd4e8cf..f9474b63229 100644 --- a/gcc/config/rs6000/xmmintrin.h +++ b/gcc/config/rs6000/xmmintrin.h @@ -1586,9 +1586,15 @@ _mm_movemask_pi8 (__m64 __A) #endif return __builtin_bpermd (p, __A); #else +#ifdef __LITTLE_ENDIAN__ unsigned int mask = 0x20283038UL; unsigned int r1 = __builtin_bpermd (mask, __A) & 0xf; unsigned int r2 = __builtin_bpermd (mask, __A >> 32) & 0xf; +#else + unsigned int mask = 0x38302820UL; + unsigned int r1 = __builtin_bpermd (mask, __A >> 32) & 0xf; + unsigned int r2 = __builtin_bpermd (mask, __A) & 0xf; +#endif return (r2 << 4) | r1; #endif }