This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Patch: PR40900, extending call patterns


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]