From owner-freebsd-hackers Fri Aug 24 13:31:38 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from mail.wrs.com (unknown-1-11.windriver.com [147.11.1.11]) by hub.freebsd.org (Postfix) with ESMTP id 5880037B407; Fri, 24 Aug 2001 13:31:35 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@[147.11.46.201]) by mail.wrs.com (8.9.3/8.9.1) with ESMTP id NAA00422; Fri, 24 Aug 2001 13:31:28 -0700 (PDT) Message-ID: X-Mailer: XFMail 1.4.0 on FreeBSD X-Priority: 3 (Normal) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 8bit MIME-Version: 1.0 In-Reply-To: <20010824161024.A45122@ussenterprise.ufp.org> Date: Fri, 24 Aug 2001 13:31:34 -0700 (PDT) From: John Baldwin To: Leo Bicknell Subject: Re: function calls/rets in assembly Cc: "David O'Brien" , freebsd-hackers@FreeBSD.org, Steve Roome Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 -- 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