From owner-freebsd-hackers@FreeBSD.ORG Mon Feb 16 17:00:09 2004 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id D51DB16A4CE for ; Mon, 16 Feb 2004 17:00:09 -0800 (PST) Received: from kientzle.com (h-66-166-149-50.SNVACAID.covad.net [66.166.149.50]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5095543D1D for ; Mon, 16 Feb 2004 17:00:09 -0800 (PST) (envelope-from kientzle@acm.org) Received: from acm.org ([66.166.149.54]) by kientzle.com (8.12.9/8.12.9) with ESMTP id i1H0xvkX045275; Mon, 16 Feb 2004 16:59:58 -0800 (PST) (envelope-from kientzle@acm.org) Message-ID: <4031678D.2060704@acm.org> Date: Mon, 16 Feb 2004 16:59:57 -0800 From: Tim Kientzle User-Agent: Mozilla/5.0 (X11; U; FreeBSD i386; en-US; rv:1.4) Gecko/20031006 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Matthew Dillon References: <200402162112.i1GLCFMV087316@apollo.backplane.com> In-Reply-To: <200402162112.i1GLCFMV087316@apollo.backplane.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: des@des.no cc: Juan Tumani cc: freebsd-hackers@freebsd.org Subject: Re: FreeBSD 5.2 v/s FreeBSD 4.9 MFLOPS performance (gcc3.3.3 v/sgcc2.9.5) X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: kientzle@acm.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 Feb 2004 01:00:09 -0000 Matthew Dillon wrote: > I'm surprised Bruce hasn't chimed in here yet. I guess he's tired of > repeating himself. > > In 4.9, libcsu, which generates crt1.o (which is the start code for > C programs which the linker links in automatically) has this line in it: > > andl $~0xf, %%esp # align stack to 16-byte boundary > > So anything linked with 4.9 is going to align the stack on a > 16 byte boundary no matter WHAT the kernel does. > > FreeBSD-5 does not have this alignment in its crt1.o because GCC3 > automatically aligns the stack on a per-procedure basis. Or at least > it is supposed to. Maybe it's broke? :-) I've not looked at 3.3, but I seem to recall that GCC 3.2 did not actually align the stack within each function, but preserved the alignment. (That is, each function assumed the stack had a certain alignment on entry and ensured that alignment was preserved for any subsequent function calls.) I had my doubts about this, as it meant there was a LOT of stack fiddling before and after every function call. (The alignment was handled at caller, not callee. A lot of functions don't need any alignment at all, really, so it seems like it could be wasted effort in a lot of cases.) If I'm remembering this correctly, then aligning the stack in crt1.o would be pretty much essential. Tim Kientzle