[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <AANLkTinbLbdPDS-MaSQ3b2BP_ykERx6EfBoJuD0ZxWdr@mail.gmail.com>
Date: Wed, 9 Feb 2011 20:32:39 -0500
From: Jidong Xiao <jidong.xiao@...il.com>
To: David Miller <davem@...emloft.net>
Cc: hpa@...or.com, linux-kernel@...r.kernel.org
Subject: Re: Can anyone explain "movl %eax %eax"?
Thank you David and Peter.
And I found more information in the following website, other people
who are not very clear can have a look at this document:
http://www.x86-64.org/documentation/assembly.html
======================
Implicit zero extend
Results of 32-bit operations are implicitly zero extended to 64-bit
values. This differs from 16 and 8 bit operations, that don't affect
the upper part of registers. This can be used for code size
optimisations in some cases, such as:
movl $1, %eax # one byte shorter movq $1, %rax
xorq %rax, %rax # three byte equivalent of mov $0,%rax
andl $5, %eax # equivalent for andq $5, %eax
======================
Regards
Jidong
On Wed, Feb 9, 2011 at 6:05 PM, David Miller <davem@...emloft.net> wrote:
> From: Jidong Xiao <jidong.xiao@...il.com>
> Date: Wed, 9 Feb 2011 18:02:09 -0500
>
>> Oh, I see. Thank you. So similarly, the operation "xorl %eax,%eax" is
>> used for the same reason, right? I see that appears in more files.
>
> The xorl clears the entire register.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists