public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Andrew Pinski <pinskia@gmail.com>
To: Bernd Schmidt <bernds@codesourcery.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: Patch: PR40900, extending call patterns
Date: Fri, 30 Apr 2010 03:33:00 -0000	[thread overview]
Message-ID: <l2ide8d50361004291813u3a7d09fdwe76c2814059eaeb4@mail.gmail.com> (raw)
In-Reply-To: <4BDA2513.9000705@codesourcery.com>

On Thu, Apr 29, 2010 at 5:32 PM, Bernd Schmidt <bernds@codesourcery.com> wrote:
> The idea is to represent the sign-extension in the RTL call patterns,
> choosing extending variants in calls.c when we notice a suitable
> promotion.  Then we let combine do its work; this needed another little
> tweak to make sure it recorded the extension of the return register.

On PowerPC (and MIPS even with 4.3.3), this is already optimized
without a sign extend.

 (call_insn 5 4 6 3 t.c:4 (parallel [
            (set (reg:SI 3 3)
                (call (mem:SI (symbol_ref:SI ("shortv2") [flags 0x41]
<function_decl 0x7fc0bfb81a00 shortv2>) [0 S4 A8])
                    (const_int 0 [0x0])))
            (use (const_int 0 [0x0]))
            (clobber (reg:SI 65 lr))
        ]) -1 (nil)
    (nil))

(insn 6 5 7 3 t.c:4 (set (reg:SI 121)
        (reg:SI 3 3)) -1 (nil))

(insn 7 6 8 3 t.c:4 (set (reg:SI 119 [ D.2012+-2 ])
        (reg:SI 121)) -1 (nil))

(insn 8 7 9 3 t.c:4 (set (reg:SI 120 [ <retval>+-2 ])
        (reg:SI 119 [ D.2012+-2 ])) -1 (nil))

--- CUT ---

Maybe I am missing something but the arm RTL should look something
similar without a sign extension.

Thanks,
Andrew Pinski

  reply	other threads:[~2010-04-30  1:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-30  1:05 Bernd Schmidt
2010-04-30  3:33 ` Andrew Pinski [this message]
2010-04-30  9:23   ` Paolo Bonzini
2010-04-30 15:09     ` Bernd Schmidt
     [not found]       ` <201005010054.17350.ebotcazou@adacore.com>
2010-05-01 10:45         ` Paolo Bonzini
2010-05-03  9:39         ` Bernd Schmidt
2010-05-05 13:01           ` Eric Botcazou
2010-05-06  7:14             ` Paolo Bonzini
2010-05-06  7:36               ` Eric Botcazou
2010-06-08 21:56             ` Bernd Schmidt
2010-06-09 22:14               ` Eric Botcazou
2010-06-11 13:58                 ` Bernd Schmidt
2010-06-16 21:23                   ` Eric Botcazou
2010-06-18  7:31                     ` Bernd Schmidt
2010-06-18 17:09                       ` Eric Botcazou

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=l2ide8d50361004291813u3a7d09fdwe76c2814059eaeb4@mail.gmail.com \
    --to=pinskia@gmail.com \
    --cc=bernds@codesourcery.com \
    --cc=gcc-patches@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).