For compatibility implementation of x86 vector intrinsic, _mm_extract_pi16,
adjust shift value for big-endian mode.
gcc/ChangeLog:
2018-10-25 Paul A. Clarke <pc@us.ibm.com>
* config/rs6000/xmmintrin.h (_mm_extract_pi16): Fix for big-endian.
From-SVN: r265531
+2018-10-26 Paul A. Clarke <pc@us.ibm.com>
+
+ * config/rs6000/xmmintrin.h (_mm_extract_pi16): Fix for big-endian.
+
2018-10-26 Richard Biener <rguenther@suse.de>
* tree-vect-slp.c (vect_mark_slp_stmts): Add visited hash_set
extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_extract_pi16 (__m64 const __A, int const __N)
{
- const int shiftr = (__N & 3) * 16;
+ unsigned int shiftr = __N & 3;
+#ifdef __BIG_ENDIAN__
+ shiftr = 3 - shiftr;
+#endif
- return ((__A >> shiftr) & 0xffff);
+ return ((__A >> (shiftr * 16)) & 0xffff);
}
extern __inline int __attribute__((__gnu_inline__, __always_inline__, __artificial__))