From owner-freebsd-current Tue Nov 30 10:22:42 1999 Delivered-To: freebsd-current@freebsd.org Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by hub.freebsd.org (Postfix) with ESMTP id 0755F159A1 for ; Tue, 30 Nov 1999 10:22:40 -0800 (PST) (envelope-from dillon@apollo.backplane.com) Received: (from dillon@localhost) by apollo.backplane.com (8.9.3/8.9.1) id KAA26455; Tue, 30 Nov 1999 10:22:36 -0800 (PST) (envelope-from dillon) Date: Tue, 30 Nov 1999 10:22:36 -0800 (PST) From: Matthew Dillon Message-Id: <199911301822.KAA26455@apollo.backplane.com> To: Marcel Moolenaar 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> <384410F3.F5247785@scc.nl> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG :> 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 SIMD? It sounds like they are trying to enforce alignment against the cache line size in general. I can sorta see how it might help, but it's a huge waste of space! -rwxr-xr-x 1 root wheel 2051069 Nov 29 17:59 kernel EGCS -rwxr-xr-x 1 root wheel 2081364 Nov 30 10:18 kernel NEW GCC -rwxr-xr-x 1 root wheel 2008468 Nov 30 10:15 kernel NEW GCC w/ -m The new GCC does a better job verses the old EGCS if you use the option to limit alignment to 4 bytes. If you do not use the option the 16 byte alignment adds 70K to the size of the kernel. All I can say to that is "bleh". The real question is whether performance is actually improved significantly or not. If not, I'd sent a nasty email to the gcc folks :-) The extra subl's are not going to cost anything in regards to cpu so the real question is whether the cache line alignment boosts performance. -Matt Matthew Dillon To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message