From owner-freebsd-current Tue Nov 30 10: 1:32 1999 Delivered-To: freebsd-current@freebsd.org Received: from post.mail.nl.demon.net (post-10.mail.nl.demon.net [194.159.73.20]) by hub.freebsd.org (Postfix) with ESMTP id DF36315925 for ; Tue, 30 Nov 1999 10:01:25 -0800 (PST) (envelope-from marcel@scc.nl) Received: from [212.238.132.94] (helo=scones.sup.scc.nl) by post.mail.nl.demon.net with esmtp (Exim 2.02 #1) id 11srae-0004Xt-00; Tue, 30 Nov 1999 18:01:24 +0000 Received: from scc.nl (scones.sup.scc.nl [192.168.2.4]) by scones.sup.scc.nl (8.9.3/8.9.3) with ESMTP id TAA57840; Tue, 30 Nov 1999 19:01:23 +0100 (CET) (envelope-from marcel@scc.nl) Message-ID: <384410F3.F5247785@scc.nl> Date: Tue, 30 Nov 1999 19:01:23 +0100 From: Marcel Moolenaar Organization: SCC vof X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.5 i386) X-Accept-Language: en MIME-Version: 1.0 To: Matthew Dillon Cc: Ville-Pertti Keinonen , current@FreeBSD.ORG Subject: Re: kernel: -mpreferred-stack-boundary=2 ?? References: <19991130133337.25847.qmail@ns.demophon.com> <199911301735.JAA25885@apollo.backplane.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Matthew Dillon wrote: > > :> > Anyhow, I'll repeat it here - stack alignment does *not* break > :> > link-compatibility. It does not change calling conventions, it just > :> > adds padding after the args to ensure that local variables can be > :> > predictably aligned. > : > :> So, how does aligning stackframes affect the inherently static property > :> of code size then? > : > :Instructions are inserted to perform that alignment (add padding). > :When the alignment is 2 (i.e. on 4-byte boundaries), no padding is > :required in typical cases. > > I can't think of a single case where the stack isn't inherently > 4-byte aligned already, whether you use the option or not. It's more a case of overriding the new behaviour of gcc to align the stack on 16-byte boundaries by default (for performance reasons for the PIII SIMD instructions, IIRC) > To whomever added the option: Did you actually test to see that > this option resulted in an improvement? If not, I recommend removing > it. It sounds like unnecessary extra junk to me. For the bootcode the option is necessary. It does remove a lot of "subl $..,%esp" instructions that bloated the code, which in turn prevented boot2 to build. It's not necessary for kernel/module builds. But the option does prevent a lot of unnecessary alignment instructions in the code... Maybe -mpreferred-stack-boundary=2 should be the default so that we don't need the option in the general case. Overriding this in certain cases, can be considered an optimisation... -- Marcel Moolenaar mailto:marcel@scc.nl SCC Internetworking & Databases http://www.scc.nl/ The FreeBSD project mailto:marcel@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message