public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug middle-end/19391] New: [4.0 Regression] missed optimization with size of 8 vectors
@ 2005-01-12  6:32 pinskia at gcc dot gnu dot org
  2005-01-12  6:34 ` [Bug middle-end/19391] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-12  6:32 UTC (permalink / raw)
  To: gcc-bugs

We do not generate the vector instructions with the following code on x86_64 (and x86 -msse3):
 typedef short mmxw  __attribute__ ((vector_size(8)));
 typedef int   mmxdw __attribute__ ((vector_size(8)));
mmxdw dw;
mmxw w;
void test(){
    w+=w;
    dw= (mmxdw)w;
}

The code comes from PR 14552 but we don't use the vector unit any more for the addition so we 
produce so much crappy code:
        movq    w(%rip), %xmm0
        movabsq $-9223231297218904064, %rax
        movq    %xmm0, -8(%rsp)
        movq    -8(%rsp), %rsi
        movq    %rsi, %rcx
        movq    %rsi, %rdx
        xorq    %rsi, %rcx
        andq    %rax, %rcx
        movabsq $9223231297218904063, %rax
        andq    %rax, %rdx
        addq    %rdx, %rdx
        xorq    %rdx, %rcx
        movq    %rcx, -16(%rsp)
        movq    -16(%rsp), %xmm0
        movq    %xmm0, w(%rip)
        movq    %xmm0, dw(%rip)
        ret

Compared to what we got in 3.4:
test:
        movq    w, %mm1
        psllw   $1, %mm1
        movq    %mm1, w
        movq    w, %mm0
        movq    %mm0, dw
        ret

-- 
           Summary: [4.0 Regression] missed optimization with size of 8
                    vectors
           Product: gcc
           Version: 4.0.0
            Status: UNCONFIRMED
          Keywords: missed-optimization, ssemmx
          Severity: normal
          Priority: P2
         Component: middle-end
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pinskia at gcc dot gnu dot org
                CC: gcc-bugs at gcc dot gnu dot org
GCC target triplet: x86_64-*-*
OtherBugsDependingO 14552
             nThis:


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


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

* [Bug middle-end/19391] [4.0 Regression] missed optimization with size of 8 vectors
  2005-01-12  6:32 [Bug middle-end/19391] New: [4.0 Regression] missed optimization with size of 8 vectors pinskia at gcc dot gnu dot org
@ 2005-01-12  6:34 ` pinskia at gcc dot gnu dot org
  2005-01-12  9:23 ` steven at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-12  6:34 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-12 06:34 -------
Note this worked with 20041124.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.0.0


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


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

* [Bug middle-end/19391] [4.0 Regression] missed optimization with size of 8 vectors
  2005-01-12  6:32 [Bug middle-end/19391] New: [4.0 Regression] missed optimization with size of 8 vectors pinskia at gcc dot gnu dot org
  2005-01-12  6:34 ` [Bug middle-end/19391] " pinskia at gcc dot gnu dot org
@ 2005-01-12  9:23 ` steven at gcc dot gnu dot org
  2005-01-12  9:54 ` rth at gcc dot gnu dot org
  2005-01-12 15:31 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: steven at gcc dot gnu dot org @ 2005-01-12  9:23 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From steven at gcc dot gnu dot org  2005-01-12 09:23 -------
Is this a regression that may be caused by RTH's rewrite? 
 

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


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


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

* [Bug middle-end/19391] [4.0 Regression] missed optimization with size of 8 vectors
  2005-01-12  6:32 [Bug middle-end/19391] New: [4.0 Regression] missed optimization with size of 8 vectors pinskia at gcc dot gnu dot org
  2005-01-12  6:34 ` [Bug middle-end/19391] " pinskia at gcc dot gnu dot org
  2005-01-12  9:23 ` steven at gcc dot gnu dot org
@ 2005-01-12  9:54 ` rth at gcc dot gnu dot org
  2005-01-12 15:31 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: rth at gcc dot gnu dot org @ 2005-01-12  9:54 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rth at gcc dot gnu dot org  2005-01-12 09:54 -------
Try again with <mmintrin.h> functions.

It is absolutely ESSENTIAL that we do NOT emit mmx vector operations UNLESS
the <mmintrin.h> routines are used.  Doing so without the compiler also 
being able to insert emms instructions is wrong-code.

-- 


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


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

* [Bug middle-end/19391] [4.0 Regression] missed optimization with size of 8 vectors
  2005-01-12  6:32 [Bug middle-end/19391] New: [4.0 Regression] missed optimization with size of 8 vectors pinskia at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2005-01-12  9:54 ` rth at gcc dot gnu dot org
@ 2005-01-12 15:31 ` pinskia at gcc dot gnu dot org
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-01-12 15:31 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-01-12 15:31 -------
(In reply to comment #3)
> Try again with <mmintrin.h> functions.
> 
> It is absolutely ESSENTIAL that we do NOT emit mmx vector operations UNLESS
> the <mmintrin.h> routines are used.  Doing so without the compiler also 
> being able to insert emms instructions is wrong-code.

Ok, but please add something to the changes page as I had thought I had saw this wording in a patch 
but I did not for sure.



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |WONTFIX


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


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

end of thread, other threads:[~2005-01-12 15:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-01-12  6:32 [Bug middle-end/19391] New: [4.0 Regression] missed optimization with size of 8 vectors pinskia at gcc dot gnu dot org
2005-01-12  6:34 ` [Bug middle-end/19391] " pinskia at gcc dot gnu dot org
2005-01-12  9:23 ` steven at gcc dot gnu dot org
2005-01-12  9:54 ` rth at gcc dot gnu dot org
2005-01-12 15:31 ` pinskia at gcc dot gnu dot org

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).