From: Andi Kleen <ak@muc.de>
To: Jamie Lokier <jamie@shareable.org>
Cc: linux-kernel@vger.kernel.org, jh@suse.cz
Subject: stack alignment in the kernel was Re: nasm over gas?
Date: Sun, 14 Sep 2003 01:57:25 +0200 [thread overview]
Message-ID: <m31xuk8cnu.fsf_-_@averell.firstfloor.org> (raw)
In-Reply-To: <vog2.7k4.23@gated-at.bofh.it> (Jamie Lokier's message of "Sat, 13 Sep 2003 21:30:18 +0200")
Jamie Lokier <jamie@shareable.org> 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
next prev parent reply other threads:[~2003-09-13 23:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <rZQN.83u.21@gated-at.bofh.it>
[not found] ` <saVL.7lR.1@gated-at.bofh.it>
[not found] ` <soFo.16a.1@gated-at.bofh.it>
[not found] ` <ssJa.6M6.25@gated-at.bofh.it>
[not found] ` <tcVB.rs.3@gated-at.bofh.it>
2003-09-08 12:03 ` nasm over gas? Ihar 'Philips' Filipau
2003-09-08 13:53 ` Richard B. Johnson
2003-09-08 16:10 ` Jamie Lokier
2003-09-08 16:17 ` Jamie Lokier
2003-09-08 16:45 ` Ihar 'Philips' Filipau
2003-09-08 16:58 ` Jamie Lokier
2003-09-08 17:59 ` William Lee Irwin III
[not found] ` <uw6d.3hD.35@gated-at.bofh.it>
[not found] ` <uxED.5Rz.9@gated-at.bofh.it>
[not found] ` <uYbM.26o.3@gated-at.bofh.it>
[not found] ` <uZUr.4QR.25@gated-at.bofh.it>
[not found] ` <v4qU.3h1.27@gated-at.bofh.it>
[not found] ` <vog2.7k4.23@gated-at.bofh.it>
2003-09-13 23:57 ` Andi Kleen [this message]
2003-09-14 13:54 ` stack alignment in the kernel was " Jamie Lokier
2003-09-14 14:13 ` Andi Kleen
2003-09-14 15:56 ` Jamie Lokier
2003-09-14 22:27 ` Jan Hubicka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m31xuk8cnu.fsf_-_@averell.firstfloor.org \
--to=ak@muc.de \
--cc=jamie@shareable.org \
--cc=jh@suse.cz \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox