All of lore.kernel.org
 help / color / mirror / Atom feed
From: "H. Peter Anvin" <hpa@zytor.com>
To: Jidong Xiao <jidong.xiao@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Can anyone explain "movl %eax %eax"?
Date: Wed, 09 Feb 2011 14:32:27 -0800	[thread overview]
Message-ID: <4D5315FB.8020004@zytor.com> (raw)
In-Reply-To: <AANLkTikA3MT=eeMKg58HyYZRswUR+PMhYW978HEc0sst@mail.gmail.com>

On 02/09/2011 02:24 PM, Jidong Xiao wrote:
> Hi,
> 
> In the kernel source, I see in a couple of places, there is "movl %eax
> %eax". Is this used for alignment purpose?
> 
> For example, in the following piece of code we can see "movl %eax,%eax".
> 

In x86-64, a dword (long) operation clears the upper 32 bits of the
target register, so "movl %eax,%eax" clears the upper 32 bits of %rax.

	-hpa


  reply	other threads:[~2011-02-09 22:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-09 22:24 Can anyone explain "movl %eax %eax"? Jidong Xiao
2011-02-09 22:32 ` H. Peter Anvin [this message]
2011-02-09 23:02   ` Jidong Xiao
2011-02-09 23:05     ` David Miller
2011-02-10  1:32       ` Jidong Xiao

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=4D5315FB.8020004@zytor.com \
    --to=hpa@zytor.com \
    --cc=jidong.xiao@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.