[Bug target/49411] [4.6/4.7] ICE: unrecognizable insn with -mxop in _mm_roti_epi8 with negative number

2011-06-18 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49411

--- Comment #7 from Jakub Jelinek jakub at gcc dot gnu.org 2011-06-18 
06:43:41 UTC ---
Author: jakub
Date: Sat Jun 18 06:43:38 2011
New Revision: 175165

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=175165
Log:
PR target/49411
* config/i386/i386.c (ix86_expand_multi_arg_builtins): If
last_arg_constant and last argument doesn't match its predicate,
for xop_vpermil2mode3 error out and for xop_rotlmode3
if it is CONST_INT, mask it, otherwise expand using rotlmode3.
(ix86_expand_sse_pcmpestr, ix86_expand_sse_pcmpistr): Fix
spelling of error message.
* config/i386/sse.md (sse4a_extrqi, sse4a_insertqi,
vcvtps2ph, *vcvtps2ph, *vcvtps2ph_store, vcvtps2ph256): Use
const_0_to_255_operand instead of const_int_operand.

Revert:
2011-05-09  Uros Bizjak  ubiz...@gmail.com

* config/i386/sse.md (blendbits): Remove mode attribute.
(sse4_1_blendssemodesuffixavxsizesuffix): Use const_int_operand
instead of const_0_to_blendbits_operand for operand 3 predicate.
Check integer value of operand 3 in insn constraint.

* gcc.target/i386/testimm-1.c: New test.
* gcc.target/i386/testimm-2.c: New test.
* gcc.target/i386/testimm-3.c: New test.
* gcc.target/i386/testimm-4.c: New test.
* gcc.target/i386/testimm-5.c: New test.
* gcc.target/i386/testimm-6.c: New test.
* gcc.target/i386/testimm-7.c: New test.
* gcc.target/i386/testimm-8.c: New test.
* gcc.target/i386/xop-vpermil2px-2.c: New test.
* gcc.target/i386/xop-rotate1-int.c: New test.
* gcc.target/i386/xop-rotate2-int.c: New test.

Added:
trunk/gcc/testsuite/gcc.target/i386/testimm-1.c
trunk/gcc/testsuite/gcc.target/i386/testimm-2.c
trunk/gcc/testsuite/gcc.target/i386/testimm-3.c
trunk/gcc/testsuite/gcc.target/i386/testimm-4.c
trunk/gcc/testsuite/gcc.target/i386/testimm-5.c
trunk/gcc/testsuite/gcc.target/i386/testimm-6.c
trunk/gcc/testsuite/gcc.target/i386/testimm-7.c
trunk/gcc/testsuite/gcc.target/i386/testimm-8.c
trunk/gcc/testsuite/gcc.target/i386/xop-rotate1-int.c
trunk/gcc/testsuite/gcc.target/i386/xop-rotate2-int.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/config/i386/i386.c
trunk/gcc/config/i386/sse.md
trunk/gcc/testsuite/ChangeLog


[Bug target/49411] [4.6/4.7] ICE: unrecognizable insn with -mxop in _mm_roti_epi8 with negative number

2011-06-18 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49411

--- Comment #8 from Jakub Jelinek jakub at gcc dot gnu.org 2011-06-18 
09:07:24 UTC ---
Author: jakub
Date: Sat Jun 18 09:07:20 2011
New Revision: 175170

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=175170
Log:
PR target/49411
* config/i386/i386.c (ix86_expand_multi_arg_builtins): If
last_arg_constant and last argument doesn't match its predicate,
for xop_vpermil2mode3 error out and for xop_rotlmode3
if it is CONST_INT, mask it, otherwise expand using rotlmode3.
(ix86_expand_sse_pcmpestr, ix86_expand_sse_pcmpistr): Fix
spelling of error message.
* config/i386/sse.md (sse4a_extrqi, sse4a_insertqi,
vcvtps2ph, *vcvtps2ph, *vcvtps2ph_store, vcvtps2ph256): Use
const_0_to_255_operand instead of const_int_operand.

* gcc.target/i386/testimm-1.c: New test.
* gcc.target/i386/testimm-2.c: New test.
* gcc.target/i386/testimm-3.c: New test.
* gcc.target/i386/testimm-4.c: New test.
* gcc.target/i386/testimm-5.c: New test.
* gcc.target/i386/testimm-6.c: New test.
* gcc.target/i386/testimm-7.c: New test.
* gcc.target/i386/testimm-8.c: New test.
* gcc.target/i386/xop-vpermil2px-2.c: New test.
* gcc.target/i386/xop-rotate1-int.c: New test.
* gcc.target/i386/xop-rotate2-int.c: New test.

Added:
branches/gcc-4_6-branch/gcc/testsuite/gcc.target/i386/testimm-1.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.target/i386/testimm-2.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.target/i386/testimm-3.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.target/i386/testimm-4.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.target/i386/testimm-5.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.target/i386/testimm-6.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.target/i386/testimm-7.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.target/i386/testimm-8.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.target/i386/xop-rotate1-int.c
branches/gcc-4_6-branch/gcc/testsuite/gcc.target/i386/xop-rotate2-int.c
Modified:
branches/gcc-4_6-branch/gcc/ChangeLog
branches/gcc-4_6-branch/gcc/config/i386/i386.c
branches/gcc-4_6-branch/gcc/config/i386/sse.md
branches/gcc-4_6-branch/gcc/testsuite/ChangeLog


[Bug target/49411] [4.6/4.7] ICE: unrecognizable insn with -mxop in _mm_roti_epi8 with negative number

2011-06-18 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49411

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution||FIXED

--- Comment #9 from Jakub Jelinek jakub at gcc dot gnu.org 2011-06-18 
09:18:55 UTC ---
Fixed.


[Bug target/49411] [4.6/4.7] ICE: unrecognizable insn with -mxop in _mm_roti_epi8 with negative number

2011-06-15 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49411

--- Comment #3 from Jakub Jelinek jakub at gcc dot gnu.org 2011-06-15 
06:32:20 UTC ---
Created attachment 24533
  -- http://gcc.gnu.org/bugzilla/attachment.cgi?id=24533
gcc47-pr49411.patch

Untested fix.  Alternatively, we could for the rotation instead just always
mask the immediate operand (the only docs I found about these intrinsics was
MSFT documentation which didn't say anything on invalid count, but even said
that the count is preferrably an integer instead of unconditionally an
integer).
Therefore, perhaps we could mask it if it is constant and expand using
rotlmode3 expander if it is not CONST_INT.


[Bug target/49411] [4.6/4.7] ICE: unrecognizable insn with -mxop in _mm_roti_epi8 with negative number

2011-06-15 Thread qneill at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49411

--- Comment #4 from Quentin Neill qneill at gcc dot gnu.org 2011-06-15 
15:38:27 UTC ---
Hi Jakub,

Thanks for looking at this.

I think we need an nargs==3 case for the Compare/Predicate generation
(_mm_com*) intrinsics as well.

And did you mean to test the value of INTVAL(op) in the nargs==4 vpermil case
before throwing an error?
-- 
Quentin


[Bug target/49411] [4.6/4.7] ICE: unrecognizable insn with -mxop in _mm_roti_epi8 with negative number

2011-06-15 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49411

--- Comment #5 from Jakub Jelinek jakub at gcc dot gnu.org 2011-06-15 
15:57:29 UTC ---
FYI, a newer patch has been posted:
http://gcc.gnu.org/ml/gcc-patches/2011-06/msg01139.html
I don't think it is necessary to test the op of vpermil again if it is
CONST_INT, we know it is not 0..3 because otherwise
insn_data[icode].operand[i + 1].predicate (op, mode)
would be true.
_mm_com* don't seem to have an constant argument, just two vector arguments, so
there is nothing to check.  The immediate comes directly from the table and so
is known to be ok.


[Bug target/49411] [4.6/4.7] ICE: unrecognizable insn with -mxop in _mm_roti_epi8 with negative number

2011-06-15 Thread qneill at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49411

--- Comment #6 from Quentin Neill qneill at gcc dot gnu.org 2011-06-15 
16:39:47 UTC ---
(In reply to comment #5)

 newer patch has been posted
Thanks; I will test this on AMD HW.

 test the op of vpermil
Okay.

 _mm_com*
I spotted them in the opcode tables, but had forgotten how those work.

I'm looking into lwpval/ins, bextr (there is an immediate) and vcvtps*


[Bug target/49411] [4.6/4.7] ICE: unrecognizable insn with -mxop in _mm_roti_epi8 with negative number

2011-06-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49411

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 CC||jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek jakub at gcc dot gnu.org 2011-06-14 
23:21:32 UTC ---
It ICEs even for positive values such as _mm_roti_epi8 (s, 76);
I think multi_arg builtin expansion needs to do constant argument checking,
at least for IX86_BUILTIN_VPROT[BWDQ]_IMM and IX86_BUILTIN_VPERMIL2P[DS]{,256}.
And for the former ones either use CODE_FOR_* of an expander that handles both
positive and negative values, where for positive one it would expand to
xop_rotl* and for negative to xop_rotr* with the shift count negated, or
the negation and choice of pattern needs to be done in
ix86_expand_multi_arg_builtin.


[Bug target/49411] [4.6/4.7] ICE: unrecognizable insn with -mxop in _mm_roti_epi8 with negative number

2011-06-14 Thread jakub at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49411

Jakub Jelinek jakub at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |ASSIGNED
   Last reconfirmed||2011.06.15 05:48:05
 AssignedTo|unassigned at gcc dot   |jakub at gcc dot gnu.org
   |gnu.org |
 Ever Confirmed|0   |1

--- Comment #2 from Jakub Jelinek jakub at gcc dot gnu.org 2011-06-15 
05:48:05 UTC ---
I'll handle this.