From owner-freebsd-current Tue Nov 30 10:47:57 1999 Delivered-To: freebsd-current@freebsd.org Received: from post.mail.nl.demon.net (post-11.mail.nl.demon.net [194.159.73.21]) by hub.freebsd.org (Postfix) with ESMTP id 92C47159CC for ; Tue, 30 Nov 1999 10:47:51 -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.12 #1) id 11ssJa-000Nnp-00; Tue, 30 Nov 1999 18:47:50 +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 TAA59489; Tue, 30 Nov 1999 19:47:47 +0100 (CET) (envelope-from marcel@scc.nl) Message-ID: <38441BD2.5540BE94@scc.nl> Date: Tue, 30 Nov 1999 19:47:46 +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> <384410F3.F5247785@scc.nl> <199911301822.KAA26455@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: > 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 :-) I guess only if you do have a PIII and are using the new instructions. In most cases this has no effect whatsoever. Not counting the significant code size increase. From the GCC manual (reproduced without explicit permission :-) -mpreferred-stack-boundary=num Attempt to keep the stack boundary aligned to a 2 raised to num byte boundary. If `-mpreferred-stack-boundary' is not specified, the default is 4 (16 bytes or 128 bits). The stack is required to be aligned on a 4 byte boundary. On Pentium and PentiumPro, double and long double values should be aligned to an 8 byte boundary (see `-malign-double') or suffer significant run time performance penalties. On Pentium III, the Streaming SIMD Extention (SSE) data type __m128 suffers similar penalties if it is not 16 byte aligned. To ensure proper alignment of this values on the stack, the stack boundary must be as aligned as that required by any value stored on the stack. Further, every function must be generated such that it keeps the stack aligned. Thus calling a function compiled with a higher preferred stack boundary from a function compiled with a lower preferred stack boundary will most likely misalign the stack. It is recommended that libraries that use callbacks always use the default setting. This extra alignment does consume extra stack space. Code that is sensitive to stack space usage, such as embedded systems and operating system kernels, may want to reduce the preferred alignment to `-mpreferred-stack-boundary=2'. -- 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