[Bug target/93673] Fake error given by gcc when compiling for _kshift intrinsics

2020-02-14 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93673

--- Comment #7 from CVS Commits  ---
The releases/gcc-8 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:fbb4d21086a20cd996049309d6c24d7fb3099123

commit r8-10019-gfbb4d21086a20cd996049309d6c24d7fb3099123
Author: Jakub Jelinek 
Date:   Fri Feb 14 15:49:32 2020 +0100

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  

PR target/93673
* config/i386/sse.md (k): Drop mode from last operand and
use const_0_to_255_operand predicate instead of immediate_operand.
(avx512dq_fpclass,
avx512dq_vmfpclass,
vgf2p8affineinvqb_,
vgf2p8affineqb_): 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.

[Bug target/93673] Fake error given by gcc when compiling for _kshift intrinsics

2020-02-13 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93673

--- Comment #6 from CVS Commits  ---
The releases/gcc-9 branch has been updated by Jakub Jelinek
:

https://gcc.gnu.org/g:488a947b2ddd57a6f44a6aecc32862f8cbf4ec77

commit r9-8225-g488a947b2ddd57a6f44a6aecc32862f8cbf4ec77
Author: Jakub Jelinek 
Date:   Thu Feb 13 08:17:07 2020 +0100

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  

PR target/93673
* config/i386/sse.md (k): Drop mode from last operand and
use const_0_to_255_operand predicate instead of immediate_operand.
(avx512dq_fpclass,
avx512dq_vmfpclass,
vgf2p8affineinvqb_,
vgf2p8affineqb_): 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.

[Bug target/93673] Fake error given by gcc when compiling for _kshift intrinsics

2020-02-12 Thread crazylht at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93673

Hongtao.liu  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #5 from Hongtao.liu  ---
Fixed in GCC10

[Bug target/93673] Fake error given by gcc when compiling for _kshift intrinsics

2020-02-12 Thread cvs-commit at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93673

--- Comment #4 from CVS Commits  ---
The master branch has been updated by Jakub Jelinek :

https://gcc.gnu.org/g:dc6d0f89d4be3ed7fde73417606a78c73d954cdf

commit r10-6612-gdc6d0f89d4be3ed7fde73417606a78c73d954cdf
Author: Jakub Jelinek 
Date:   Thu Feb 13 08:17:07 2020 +0100

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  

PR target/93673
* config/i386/sse.md (k): Drop mode from last operand and
use const_0_to_255_operand predicate instead of immediate_operand.
(avx512dq_fpclass,
avx512dq_vmfpclass,
vgf2p8affineinvqb_,
vgf2p8affineqb_): 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.

[Bug target/93673] Fake error given by gcc when compiling for _kshift intrinsics

2020-02-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93673

--- Comment #3 from Jakub Jelinek  ---
Created attachment 47816
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=47816=edit
gcc10-pr93673.patch

I meant this actually.  QImode for const_0_to_255_operand is wrong, because
QImode CONST_INTs are -128 to 127 rather than 0 to 255.

[Bug target/93673] Fake error given by gcc when compiling for _kshift intrinsics

2020-02-11 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93673

--- Comment #2 from H.J. Lu  ---
Something like this:

diff --git a/gcc/config/i386/sse.md b/gcc/config/i386/sse.md
index 902ea318999..b3b6552e13b 100644
--- a/gcc/config/i386/sse.md
+++ b/gcc/config/i386/sse.md
@@ -1650,7 +1650,7 @@ (define_insn "k"
   [(set (match_operand:SWI1248_AVX512BWDQ 0 "register_operand" "=k")
   (any_lshift:SWI1248_AVX512BWDQ
 (match_operand:SWI1248_AVX512BWDQ 1 "register_operand" "k")
-(match_operand:QI 2 "immediate_operand" "n")))
+(match_operand:QI 2 "const_0_to_255_operand")))
(unspec [(const_int 0)] UNSPEC_MASKOP)]
   "TARGET_AVX512F"
   "k\t{%2, %1, %0|%0, %1, %2}"

[Bug target/93673] Fake error given by gcc when compiling for _kshift intrinsics

2020-02-11 Thread jakub at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93673

Jakub Jelinek  changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2020-02-11
 CC||jakub at gcc dot gnu.org
   Assignee|unassigned at gcc dot gnu.org  |jakub at gcc dot gnu.org
 Ever confirmed|0   |1

[Bug target/93673] Fake error given by gcc when compiling for _kshift intrinsics

2020-02-11 Thread crazylht at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93673

--- Comment #1 from Hongtao.liu  ---
Affected instrinsics
_kshiftli_mask16
_kshiftri_mask16