public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "lessen42+gcc at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug middle-end/40893] ARM and PPC truncate intermediate operations unnecessarily
Date: Tue, 28 Jul 2009 22:28:00 -0000	[thread overview]
Message-ID: <20090728222740.25108.qmail@sourceware.org> (raw)
In-Reply-To: <bug-40893-17992@http.gcc.gnu.org/bugzilla/>



------- Comment #1 from lessen42+gcc at gmail dot com  2009-07-28 22:27 -------
More specifically, on x86_64 the following is generated with gcc-4.4 -O3
-march=core2 -S
_dct2x2dc_dconly:
        movswl  2(%rdi),%edx
        pushq   %rbp
        addw    (%rdi), %dx
        movswl  6(%rdi),%eax
        movq    %rsp, %rbp
        addw    4(%rdi), %ax
        leal    (%rax,%rdx), %ecx
        subw    %ax, %dx
        movw    %cx, (%rdi)
        movw    %dx, 2(%rdi)
        leave
        ret

So it seems that the optimizer realizes that you don't need registers larger
than 16-bits, which allows memory operands on x86, which is optimal for this
case. However, other architectures follow this too literally, wasting
instructions to truncate intermediate results to 16 bits.


-- 


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


  reply	other threads:[~2009-07-28 22:28 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-28 16:28 [Bug middle-end/40893] New: " lessen42+gcc at gmail dot com
2009-07-28 22:28 ` lessen42+gcc at gmail dot com [this message]
2009-09-09 16:34 ` [Bug middle-end/40893] " ramana at gcc dot gnu dot org
     [not found] <bug-40893-4@http.gcc.gnu.org/bugzilla/>
2010-10-05 18:14 ` paul at pwsan dot com
2010-10-08 13:05 ` rearnsha at gcc dot gnu.org
2010-10-08 17:17 ` paul at pwsan dot com

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