public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ubizjak at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/32735] i686 sse2 generates more movdqa than necessary
Date: Thu, 12 Jul 2007 08:22:00 -0000	[thread overview]
Message-ID: <20070712082211.30329.qmail@sourceware.org> (raw)
In-Reply-To: <bug-32735-11211@http.gcc.gnu.org/bugzilla/>



------- Comment #5 from ubizjak at gmail dot com  2007-07-12 08:22 -------
(In reply to comment #0)

> The loop for CallSumDeltas2 compiles to:
> 
> .L7:
>         movdqa  %xmm1, %xmm0
>         pslldq  $4, %xmm0
>         addl    $1, %eax
>         paddd   %xmm1, %xmm0
>         cmpl    $100000000, %eax
>         movdqa  %xmm0, %xmm1
>         pslldq  $8, %xmm1
>         paddd   %xmm1, %xmm0
>         movdqa  %xmm0, %xmm1
>         movdqa  %xmm0, foo1
>         jne     .L7
> 
> ===
> 
> This is two more movdqa then the hand-written code in CallSumDeltas3.

         paddd   %xmm1, %xmm0       (2)
         movdqa  %xmm0, %xmm1       (2)
         movdqa  %xmm0, foo1        (1)
         jne     .L7

(1) is assignment to a global variable. I'm not sure that it can be pushed out
of the loop, but this can be solved by adding a local temporary in
CallSumDeltas2().

(2) is probably regmove, failing to optimize:

(set (reg:V4SI 21 xmm0 [72])
     (plus:V4SI (reg:V4SI 21 xmm0 [69])
                (reg:V4SI 22 xmm1 [71]))) 843 {*addv4si3} (nil))

(set (reg:V2DI 22 xmm1 [orig:73 foo1 ] [73])
     (reg:V2DI 21 xmm0 [72])) 698 {*movv2di_internal} (nil))

into

(set (reg:V4SI 21 xmm1 [72])
     (plus:V4SI (reg:V4SI 21 xmm1 [69])
                (reg:V4SI 22 xmm0 [71]))) 843 {*addv4si3} (nil))


-- 


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


  parent reply	other threads:[~2007-07-12  8:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-12  1:30 [Bug c++/32735] New: " mec at google dot com
2007-07-12  1:30 ` [Bug c++/32735] " mec at google dot com
2007-07-12  1:31 ` mec at google dot com
2007-07-12  1:33 ` mec at google dot com
2007-07-12  1:33 ` mec at google dot com
2007-07-12  8:22 ` ubizjak at gmail dot com [this message]
2007-07-14 14:04 ` [Bug target/32735] " ubizjak at gmail dot com
     [not found] <bug-32735-4@http.gcc.gnu.org/bugzilla/>
2022-01-11 10:09 ` pinskia at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070712082211.30329.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).