diff options
author | Paul A. Clarke <pc@us.ibm.com> | 2018-04-13 23:13:40 +0000 |
---|---|---|
committer | Segher Boessenkool <segher@gcc.gnu.org> | 2018-04-14 01:13:40 +0200 |
commit | eef4632c6b3c95aadf73a46ace6aba263c10e709 (patch) | |
tree | 9b216126cd5cafcb739ed60ff7f646c443283efa /gcc/fortran/trans-array.c | |
parent | 53bdbcbc1265cd2a35bc24d5d4f36510e34174fe (diff) | |
download | gcc-eef4632c6b3c95aadf73a46ace6aba263c10e709.zip gcc-eef4632c6b3c95aadf73a46ace6aba263c10e709.tar.gz gcc-eef4632c6b3c95aadf73a46ace6aba263c10e709.tar.bz2 |
rs6000: Fix _mm_slli_epi{32,64} for shift values 16 through 31 and negative (PR84302)
The powerpc versions of _mm_slli_epi32 and __mm_slli_epi64 in emmintrin.h
do not properly handle shift values between 16 and 31, inclusive.
These are setting up the shift with vec_splat_s32, which only accepts
*5 bit signed* shift values, or a range of -16 to 15. Values above 15
produce an error:
error: argument 1 must be a 5-bit signed literal
Fix is to effectively reduce the range for which vec_splat_s32 is used
to < 32 and use vec_splats otherwise.
Also, __mm_slli_epi{16,32,64}, when given a negative shift value,
should always return a vector of {0}.
PR target/83402
* config/rs6000/emmintrin.h (_mm_slli_epi{16,32,64}):
Ensure that vec_splat_s32 is only called with 0 <= shift < 16.
Ensure negative shifts result in {0}.
gcc/testsuite/
PR target/83402
* gcc.target/powerpc/sse2-psllw-1.c: Refactor and add tests for
several values: positive, negative, and zero.
* gcc.target/powerpc/sse2-pslld-1.c: Same.
* gcc.target/powerpc/sse2-psllq-1.c: Same.
From-SVN: r259380
Diffstat (limited to 'gcc/fortran/trans-array.c')
0 files changed, 0 insertions, 0 deletions