i386: Fix k*shift* intrinsics [PR93673]
authorJakub Jelinek <jakub@redhat.com>
Thu, 13 Feb 2020 07:17:07 +0000 (08:17 +0100)
committerJakub Jelinek <jakub@redhat.com>
Thu, 13 Feb 2020 07:17:07 +0000 (08:17 +0100)
commitdc6d0f89d4be3ed7fde73417606a78c73d954cdf
tree44ad40e0e78ecd109cdfee1d6a5d61a6e139d840
parent74ddc9b8e550c6138862f9ca1eec4374d46667fc
i386: Fix k*shift* intrinsics [PR93673]

As mentioned in the PR, the intrinsics allow counts from 0 to 255, but
we actually reject values from 128 to 255.  That is because QImode
CONST_INTs can be only -128 to 127.  Fixed by using const_0_to_255_operand
and dropping the modes for the operands with those predicates
(the IL actually contains the CONST_INT which has VOIDmode).

2020-02-13  Jakub Jelinek  <jakub@redhat.com>

PR target/93673
* config/i386/sse.md (k<code><mode>): Drop mode from last operand and
use const_0_to_255_operand predicate instead of immediate_operand.
(avx512dq_fpclass<mode><mask_scalar_merge_name>,
avx512dq_vmfpclass<mode><mask_scalar_merge_name>,
vgf2p8affineinvqb_<mode><mask_name>,
vgf2p8affineqb_<mode><mask_name>): Drop mode from
const_0_to_255_operand predicated operands.

* gcc.target/i386/avx512f-pr93673.c: New test.
* gcc.target/i386/avx512dq-pr93673.c: New test.
* gcc.target/i386/avx512bw-pr93673.c: New test.
gcc/ChangeLog
gcc/config/i386/sse.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/avx512bw-pr93673.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512dq-pr93673.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/avx512f-pr93673.c [new file with mode: 0644]