From owner-freebsd-chat Tue Jul 24 12:14:49 2001 Delivered-To: freebsd-chat@freebsd.org Received: from meow.osd.bsdi.com (meow.osd.bsdi.com [204.216.28.88]) by hub.freebsd.org (Postfix) with ESMTP id 0AB7437B405; Tue, 24 Jul 2001 12:14:46 -0700 (PDT) (envelope-from jhb@FreeBSD.org) Received: from laptop.baldwin.cx (john@jhb-laptop.osd.bsdi.com [204.216.28.241]) by meow.osd.bsdi.com (8.11.4/8.11.2) with ESMTP id f6OJDNv22533; Tue, 24 Jul 2001 12:13:23 -0700 (PDT) (envelope-from jhb@FreeBSD.org) 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: <20010724200251.A72789@dogma.freebsd-uk.eu.org> Date: Tue, 24 Jul 2001 12:13:28 -0700 (PDT) From: John Baldwin To: j mckitrick Subject: Re: stack use preference Cc: Greg Lehey , freebsd-chat@FreeBSD.org Sender: owner-freebsd-chat@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 24-Jul-01 j mckitrick wrote: >| Yes. On x86, doing >| >| enter $8, $0 ; 8 bytes of local storage >| >| is equivalent to: >| >| push %ebp >| mov %esp, %ebp >| sub $8, %esp >| >| but most compilers that I've seen unroll 'enter' rather than using it >| directly. >| *shrug* > > From what I have discovered, 'enter' uses more cycles than the corresponding > instructions, and yet 'leave' does not. That is what I seem to recall as well. On the 386, enter $8, $0 would take 10 cycles, whereas the separate instructions would take 2 + 2 + 2 = 6 cycles. Granted these instructions all have RAW dependencies, and I'm not sure if that would wreak havoc in the form of register stalls on 686+ or not which might drown out the 1 or 2 cycles saved on 686+. -- 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-chat" in the body of the message