public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/45142]  New: split for *vec_set<mode>_0_sse2 incomplete
@ 2010-07-30 10:46 rguenth at gcc dot gnu dot org
  2010-07-30 14:17 ` [Bug target/45142] " rth at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-07-30 10:46 UTC (permalink / raw)
  To: gcc-bugs

t.c:24:1: error: could not split insn
(insn:TI 20 47 43 (set (mem/c:V4SI (reg/f:DI 7 sp) [3 %sfp+-64 S16 A128])
        (vec_merge:V4SI (vec_duplicate:V4SI (reg:SI 0 ax))
            (mem/c:V4SI (reg/f:DI 7 sp) [3 %sfp+-64 S16 A128])
            (const_int 1 [0x1]))) t.c:16 1424 {*vec_setv4si_0_sse2}
     (expr_list:REG_DEAD (reg:SI 0 ax)
        (expr_list:REG_EQUAL (vec_merge:V4SI (vec_duplicate:V4SI (mem/j/i:SI
(plus:DI (plus:DI (mult:DI (reg:DI 5 di [orig:68 argc ] [68])
                                    (const_int 4 [0x4]))
                                (reg/f:DI 7 sp))
                            (const_int 16 [0x10])) [2 vectmp.4 S4 A32]))
                (const_vector:V4SI [
                        (const_int 0 [0])
                        (const_int 3 [0x3])
                        (const_int 2 [0x2])
                        (const_int 1 [0x1])
                    ])
                (const_int 1 [0x1]))
            (nil))))
t.c:24:1: internal compiler error: in final_scan_insn, at final.c:2645

Which is because while the insn matches

(define_insn "*vec_set<mode>_0_sse2"
  [(set (match_operand:SSEMODE4S 0 "nonimmediate_operand"  "=x, x,x,m")
        (vec_merge:SSEMODE4S
          (vec_duplicate:SSEMODE4S
            (match_operand:<ssescalarmode> 2
              "general_operand"                            " m,*r,x,x*rfF"))
          (match_operand:SSEMODE4S 1 "vector_move_operand" " C, C,0,0")
          (const_int 1)))]
  "TARGET_SSE2"
  "@
   mov<ssescalarmodesuffix>\t{%2, %0|%0, %2}
   movd\t{%2, %0|%0, %2}
   movss\t{%2, %0|%0, %2}
   #"
  [(set_attr "type" "ssemov")
   (set_attr "mode" "<ssescalarmode>,SI,SF,*")])

the only matching split is

(define_split
  [(set (match_operand:V4SF 0 "memory_operand" "")
        (vec_merge:V4SF
          (vec_duplicate:V4SF
            (match_operand:SF 1 "nonmemory_operand" ""))
          (match_dup 0)
          (const_int 1)))]
  "TARGET_SSE && reload_completed"
  [(const_int 0)]
{
  emit_move_insn (adjust_address (operands[0], SFmode, 0), operands[1]);
  DONE;
})

which only allows V4SF mode.  It probably should be macroized to use
SSEMODE4S.


-- 
           Summary: split for *vec_set<mode>_0_sse2 incomplete
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: target
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rguenth at gcc dot gnu dot org
GCC target triplet: x86-64-*-*, i?86-*-*


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45142


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/45142] split for *vec_set<mode>_0_sse2 incomplete
  2010-07-30 10:46 [Bug target/45142] New: split for *vec_set<mode>_0_sse2 incomplete rguenth at gcc dot gnu dot org
@ 2010-07-30 14:17 ` rth at gcc dot gnu dot org
  2010-07-30 14:25 ` rguenth at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rth at gcc dot gnu dot org @ 2010-07-30 14:17 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from rth at gcc dot gnu dot org  2010-07-30 14:17 -------
Test case?


-- 

rth at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rth at gcc dot gnu dot org


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45142


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/45142] split for *vec_set<mode>_0_sse2 incomplete
  2010-07-30 10:46 [Bug target/45142] New: split for *vec_set<mode>_0_sse2 incomplete rguenth at gcc dot gnu dot org
  2010-07-30 14:17 ` [Bug target/45142] " rth at gcc dot gnu dot org
@ 2010-07-30 14:25 ` rguenth at gcc dot gnu dot org
  2010-07-31 10:55 ` ubizjak at gmail dot com
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-07-30 14:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from rguenth at gcc dot gnu dot org  2010-07-30 14:24 -------
Created an attachment (id=21360)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21360&action=view)
required patch

Together with attached patch (from the vector-enhancement GSoC project).

#define vector(elcount, type)  \
__attribute__((vector_size((elcount)*sizeof(type)))) type

#define vidx(type, vec, idx) (*(((type *) &(vec)) + idx))

int main (int argc, char **argv)
{
   vector (4, int) i0 = {argc, 1,2,3};
   vector(4,int) i2;
   vector (4, int) imask = {0,3,2,1};
   int a, b, c;

   if (argc > 4)
       __builtin_abort ();

   i2 = __builtin_shuffle (imask, i0);

   b = 0;
   if (vidx (int,imask,b) == vidx (int, i2, b))
      __builtin_abort ();

   return 0;
}

ICEs at -O2 on x86_64.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45142


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/45142] split for *vec_set<mode>_0_sse2 incomplete
  2010-07-30 10:46 [Bug target/45142] New: split for *vec_set<mode>_0_sse2 incomplete rguenth at gcc dot gnu dot org
  2010-07-30 14:17 ` [Bug target/45142] " rth at gcc dot gnu dot org
  2010-07-30 14:25 ` rguenth at gcc dot gnu dot org
@ 2010-07-31 10:55 ` ubizjak at gmail dot com
  2010-07-31 11:03 ` ubizjak at gmail dot com
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2010-07-31 10:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from ubizjak at gmail dot com  2010-07-31 10:54 -------
Created an attachment (id=21363)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21363&action=view)
Untested patch

> which only allows V4SF mode.  It probably should be macroized to use
> SSEMODE4S.

Yes, it should handle all modes of "vec_set<mode>_0" insn. Attached patch fixes
this oversight and fixes the failure.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45142


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/45142] split for *vec_set<mode>_0_sse2 incomplete
  2010-07-30 10:46 [Bug target/45142] New: split for *vec_set<mode>_0_sse2 incomplete rguenth at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2010-07-31 10:55 ` ubizjak at gmail dot com
@ 2010-07-31 11:03 ` ubizjak at gmail dot com
  2010-07-31 11:18 ` rguenther at suse dot de
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2010-07-31 11:03 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 846 bytes --]



------- Comment #4 from ubizjak at gmail dot com  2010-07-31 11:02 -------
BTW: Even with the fix, the testcase fails with -O2 -mavx:

pr45142.c: In function ‘main’:
pr45142.c:6:5: error: invalid conversion in gimple call
vector(4) int

vector(16) char

# VUSE <.MEM_38>
i2.1_4 = __builtin_ia32_pshufb128 ({ 0, 3, 2, 1 }, mask.4);

pr45142.c:6:5: internal compiler error: verify_stmts failed


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-07-31 11:02:57
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45142


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/45142] split for *vec_set<mode>_0_sse2 incomplete
  2010-07-30 10:46 [Bug target/45142] New: split for *vec_set<mode>_0_sse2 incomplete rguenth at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2010-07-31 11:03 ` ubizjak at gmail dot com
@ 2010-07-31 11:18 ` rguenther at suse dot de
  2010-07-31 12:06 ` rguenth at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenther at suse dot de @ 2010-07-31 11:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from rguenther at suse dot de  2010-07-31 11:17 -------
Subject: Re:  split for *vec_set<mode>_0_sse2 incomplete

On Sat, 31 Jul 2010, ubizjak at gmail dot com wrote:

> ------- Comment #4 from ubizjak at gmail dot com  2010-07-31 11:02 -------
> BTW: Even with the fix, the testcase fails with -O2 -mavx:
> 
> pr45142.c: In function ?main?:
> pr45142.c:6:5: error: invalid conversion in gimple call
> vector(4) int
> 
> vector(16) char
> 
> # VUSE <.MEM_38>
> i2.1_4 = __builtin_ia32_pshufb128 ({ 0, 3, 2, 1 }, mask.4);
> 
> pr45142.c:6:5: internal compiler error: verify_stmts failed

Yes, that's a known issue with that version of the patch.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45142


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/45142] split for *vec_set<mode>_0_sse2 incomplete
  2010-07-30 10:46 [Bug target/45142] New: split for *vec_set<mode>_0_sse2 incomplete rguenth at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2010-07-31 11:18 ` rguenther at suse dot de
@ 2010-07-31 12:06 ` rguenth at gcc dot gnu dot org
  2010-08-01 10:01 ` ubizjak at gmail dot com
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-07-31 12:06 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from rguenth at gcc dot gnu dot org  2010-07-31 12:06 -------
-   (set_attr "mode" "SF")])
+   (set_attr "mode" "SF,SF,*")])

SI?


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45142


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/45142] split for *vec_set<mode>_0_sse2 incomplete
  2010-07-30 10:46 [Bug target/45142] New: split for *vec_set<mode>_0_sse2 incomplete rguenth at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2010-07-31 12:06 ` rguenth at gcc dot gnu dot org
@ 2010-08-01 10:01 ` ubizjak at gmail dot com
  2010-08-01 10:42 ` uros at gcc dot gnu dot org
  2010-08-01 10:43 ` ubizjak at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2010-08-01 10:01 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from ubizjak at gmail dot com  2010-08-01 10:01 -------
(In reply to comment #6)
> -   (set_attr "mode" "SF")])
> +   (set_attr "mode" "SF,SF,*")])
> 
> SI?

No, this belongs to movss insns from "vec_set<mode>_0" pattern.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45142


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/45142] split for *vec_set<mode>_0_sse2 incomplete
  2010-07-30 10:46 [Bug target/45142] New: split for *vec_set<mode>_0_sse2 incomplete rguenth at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2010-08-01 10:01 ` ubizjak at gmail dot com
@ 2010-08-01 10:42 ` uros at gcc dot gnu dot org
  2010-08-01 10:43 ` ubizjak at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: uros at gcc dot gnu dot org @ 2010-08-01 10:42 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from uros at gcc dot gnu dot org  2010-08-01 10:42 -------
Subject: Bug 45142

Author: uros
Date: Sun Aug  1 10:41:57 2010
New Revision: 162797

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=162797
Log:
        PR target/45142
        * config/i386/sse.md (vec_set<mode>_0): Do not set mode attribute for
        alternative 2.
        (vec_set<moode>_0 splitter): Use SSEMODE4S mode iterator to also
        split V4SI operands.


Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/config/i386/sse.md


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45142


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Bug target/45142] split for *vec_set<mode>_0_sse2 incomplete
  2010-07-30 10:46 [Bug target/45142] New: split for *vec_set<mode>_0_sse2 incomplete rguenth at gcc dot gnu dot org
                   ` (7 preceding siblings ...)
  2010-08-01 10:42 ` uros at gcc dot gnu dot org
@ 2010-08-01 10:43 ` ubizjak at gmail dot com
  8 siblings, 0 replies; 10+ messages in thread
From: ubizjak at gmail dot com @ 2010-08-01 10:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from ubizjak at gmail dot com  2010-08-01 10:43 -------
Fixed.


-- 

ubizjak at gmail dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |4.6.0


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45142


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2010-08-01 10:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-30 10:46 [Bug target/45142] New: split for *vec_set<mode>_0_sse2 incomplete rguenth at gcc dot gnu dot org
2010-07-30 14:17 ` [Bug target/45142] " rth at gcc dot gnu dot org
2010-07-30 14:25 ` rguenth at gcc dot gnu dot org
2010-07-31 10:55 ` ubizjak at gmail dot com
2010-07-31 11:03 ` ubizjak at gmail dot com
2010-07-31 11:18 ` rguenther at suse dot de
2010-07-31 12:06 ` rguenth at gcc dot gnu dot org
2010-08-01 10:01 ` ubizjak at gmail dot com
2010-08-01 10:42 ` uros at gcc dot gnu dot org
2010-08-01 10:43 ` ubizjak at gmail dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).