[rs6000] Fix _mm_extract_pi16 for big-endian

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
This commit is contained in:
Paul A. Clarke 2018-10-26 15:01:22 +00:00 committed by Paul Clarke
parent 4bfcf87914
commit 4fa008a718
2 changed files with 9 additions and 2 deletions

View File

@ -1,3 +1,7 @@
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

View File

@ -1386,9 +1386,12 @@ _mm_load_ps1 (float const *__P)
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__))