Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 24 Aug 2001 13:31:34 -0700 (PDT)
From:      John Baldwin <jhb@FreeBSD.org>
To:        Leo Bicknell <bicknell@ufp.org>
Cc:        "David O'Brien" <obrien@FreeBSD.org>, freebsd-hackers@FreeBSD.org, Steve Roome <stephen_roome@yahoo.com>
Subject:   Re: function calls/rets in assembly
Message-ID:  <XFMail.010824133134.jhb@FreeBSD.org>
In-Reply-To: <20010824161024.A45122@ussenterprise.ufp.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On 24-Aug-01 Leo Bicknell wrote:
> 
> Someone suggested to me privately turning on optimization, for
> the record that doesn't help much: (with -O2)

Actually, it's fairly close to what I proposed.  It even axed the addl after
the call.  The only weirdness is the subl/addl dinking with gcc.  I've no idea
what that is about.  Perhaps it is using that to align code to a certain
boundary to optimize the ret inside printf?  (Make it fetch at the start of a
cache line or some such.)

>         .p2align 2,0x90
> .globl printasint
>         .type    printasint,@function
> printasint:
>         pushl %ebp
>         movl %esp,%ebp
>         subl $8,%esp
>         addl $-8,%esp
>         pushl 8(%ebp)
>         pushl $.LC0
>         call printf
>         leave
>         ret
> .Lfe1:
>         .size    printasint,.Lfe1-printasint
>         .ident  "[ASM_FILE_END]GCC: (c) 2.95.2 19991024 (release)"

-- 

John Baldwin <jhb@FreeBSD.org> -- http://www.FreeBSD.org/~jhb/
PGP Key: http://www.baldwin.cx/~john/pgpkey.asc
"Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?XFMail.010824133134.jhb>