diff options
author | Jakub Jelinek <jakub@redhat.com> | 2019-09-09 12:31:02 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2019-09-09 12:31:02 +0200 |
commit | ca47c3987c09df50cd9504652e4a8f6f8656bf94 (patch) | |
tree | 0781d771ad07319e24fbfb934db45c70509e4cd8 | |
parent | b245befcdd8ca0c38df47ea86537b92881490591 (diff) | |
download | gcc-ca47c3987c09df50cd9504652e4a8f6f8656bf94.zip gcc-ca47c3987c09df50cd9504652e4a8f6f8656bf94.tar.gz gcc-ca47c3987c09df50cd9504652e4a8f6f8656bf94.tar.bz2 |
re PR target/87853 (_mm_cmpgt_epi8 broken with -funsigned-char)
PR target/87853
* config/i386/emmintrin.h (_mm_cmpeq_epi8): Use casts to __v16qi
instead of __v16qs.
* gcc.target/i386/pr87853.c: New test.
From-SVN: r275508
-rw-r--r-- | gcc/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/config/i386/emmintrin.h | 2 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/testsuite/gcc.target/i386/pr87853.c | 20 |
4 files changed, 28 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index fc56822..6c749d2 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,9 @@ 2019-09-09 Jakub Jelinek <jakub@redhat.com> + PR target/87853 + * config/i386/emmintrin.h (_mm_cmpeq_epi8): Use casts to __v16qi + instead of __v16qs. + PR target/91704 * config/i386/avxintrin.h (__v32qs): New typedef. * config/i386/avx2intrin.h (_mm256_cmpgt_epi8): Use casts to __v32qs diff --git a/gcc/config/i386/emmintrin.h b/gcc/config/i386/emmintrin.h index f9e7b33..1683d84 100644 --- a/gcc/config/i386/emmintrin.h +++ b/gcc/config/i386/emmintrin.h @@ -1308,7 +1308,7 @@ _mm_xor_si128 (__m128i __A, __m128i __B) extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) _mm_cmpeq_epi8 (__m128i __A, __m128i __B) { - return (__m128i) ((__v16qs)__A == (__v16qs)__B); + return (__m128i) ((__v16qi)__A == (__v16qi)__B); } extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__, __artificial__)) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index d1c448a..ec2872b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 2019-09-09 Jakub Jelinek <jakub@redhat.com> + PR target/87853 + * gcc.target/i386/pr87853.c: New test. + PR target/91704 * gcc.target/i386/pr91704.c: New test. diff --git a/gcc/testsuite/gcc.target/i386/pr87853.c b/gcc/testsuite/gcc.target/i386/pr87853.c new file mode 100644 index 0000000..9a28887 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr87853.c @@ -0,0 +1,20 @@ +/* PR target/87853 */ +/* { dg-do compile } */ +/* { dg-options "-O2 -funsigned-char -msse2 -mno-sse3 -masm=att" } */ +/* { dg-final { scan-assembler-times "\tpcmpgtb\t%xmm" 2 } } */ +/* { dg-final { scan-assembler-not "\tpsubusb\t" } } */ +/* { dg-final { scan-assembler-not "\tpcmpeqb\t" } } */ + +#include <x86intrin.h> + +__m128i +foo (__m128i x, __m128i y) +{ + return _mm_cmpgt_epi8 (x, y); +} + +__m128i +bar (__m128i x, __m128i y) +{ + return _mm_cmplt_epi8 (x, y); +} |