From: Brian Raiter <breadbox@muppetlabs.com>
To: linux-assembly@vger.kernel.org
Subject: Re: GCC Optimization?
Date: Mon, 22 Nov 2004 17:06:06 -0800 [thread overview]
Message-ID: <16802.36094.728820.244374@eidolon.muppetlabs.com> (raw)
In-Reply-To: <2462.1101169594@www25.gmx.net>
> But why do they use and .... I think and does only even %esp
> so that the last 4 Bits are set to Zero.
> But if %esp was 0xcccccccc before it would now be 0xccccccc0
> what happens to the 4 Bits from 0xccccccc0 to 0xcccccccc?
> And what is this good for?
The x86 push and pop instructions are much, much less efficient if the
stack pointer is not dword-aligned. So if one function (say) pushes a
segment register onto the stack, it can affect the performance of
every function that is called from there.
> Second question:
> What does mov $0x0,%eax? Why dont they use xor %eax and what is it
> good for?
It zeros the accumulator, of course. As for why they don't use xor,
why should they? What would be the advantage?
> Third question:
> What is sub %eax,%esp good for? We subtract 0 from
> esp... mmmhh... for what?
Did you try building the same code with gcc optimizations turned on?
b
next prev parent reply other threads:[~2004-11-23 1:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-23 0:26 GCC Optimization? asmfreshmeat
2004-11-23 1:06 ` Brian Raiter [this message]
2004-11-23 16:43 ` Mateusz Marzantowicz
-- strict thread matches above, loose matches on Subject: below --
2004-11-23 9:22 an0nym
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=16802.36094.728820.244374@eidolon.muppetlabs.com \
--to=breadbox@muppetlabs.com \
--cc=linux-assembly@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;
as well as URLs for NNTP newsgroup(s).