Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S262265AbTIMX5t (ORCPT ); Sat, 13 Sep 2003 19:57:49 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S262268AbTIMX5t (ORCPT ); Sat, 13 Sep 2003 19:57:49 -0400 Received: from zero.aec.at ([193.170.194.10]:8966 "EHLO zero.aec.at") by vger.kernel.org with ESMTP id S262265AbTIMX5r (ORCPT ); Sat, 13 Sep 2003 19:57:47 -0400 To: Jamie Lokier Cc: linux-kernel@vger.kernel.org, jh@suse.cz Subject: stack alignment in the kernel was Re: nasm over gas? From: Andi Kleen Date: Sun, 14 Sep 2003 01:57:25 +0200 In-Reply-To: (Jamie Lokier's message of "Sat, 13 Sep 2003 21:30:18 +0200") Message-ID: User-Agent: Gnus/5.090013 (Oort Gnus v0.13) Emacs/21.2 (i586-suse-linux) References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1242 Lines: 28 Jamie Lokier writes: > Obvious the _intent_ of -O2 is to compile for speed, but it's clear > that GCC often emits trivially redundant instructions (like stack > adjustments) that don't serve to speed up the program at all. The stack adjustments are for getting good performance with floating point code. Most x86 CPUs require 16 byte alignment for floating point stores/loads on the stack. It can make a dramatic difference in some FP intensive programs. But obviously that's completely useless for the kernel which never uses floating point. A compiler option to turn it off would make sense to save .text space and eliminate these useless instructions. Especially since the kernel entry points make no attempt to align the stack to 16 byte anyways, so most likely the stack adjustments do not even work. (this option could also warn for floating point usage which is usually illegal, although you can already get the same effect by compiling with -msoft-float) -Andi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/