x86: Cast to unsigned short first for _mm_extract_pi16
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 1 Jan 2021 13:30:34 +0000 (05:30 -0800)
committerH.J. Lu <hjl.tools@gmail.com>
Tue, 5 Jan 2021 13:08:00 +0000 (05:08 -0800)
commitaf60b0ec79e9c5d7116122b185e44927aca5aa07
tree25cbb3ae71421a53a05979f6af3c6c3c45133b93
parentb679559385fea911d5cfaf67e11d1a274b379d97
x86: Cast to unsigned short first for _mm_extract_pi16

_mm_extract_pi16 is intrinsic for pextrw, which should be zero-extended,
not sign-extended.

gcc/

PR target/98495
* config/i386/xmmintrin.h (_mm_extract_pi16): Cast to unsigned
short first.

gcc/testsuite/

PR target/98495
* gcc.target/i386/pr98495-1.c: New test.
* gcc.target/i386/pr98495-2.c: New test.
* gcc.target/i386/pr98495-3.c: New test.
* gcc.target/i386/pr98495-4.c: New test.
* gcc.target/i386/pr98495-5.c: New test.
gcc/config/i386/xmmintrin.h
gcc/testsuite/gcc.target/i386/pr98495-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr98495-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr98495-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr98495-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr98495-5.c [new file with mode: 0644]