svn commit: r241744 - projects/bhyve/usr.sbin/bhyve

Andriy Gapon avg at FreeBSD.org
Wed Oct 24 06:24:07 UTC 2012


on 24/10/2012 08:40 Peter Grehan said the following:
> Hi Andriy,
> 
>> If this code emulates something like mov into %eax on AMDD64, then it should
>> clear
>> upper 32-bits of %rax.  Which I think your original code already did, but in a
>> less obvious way than Jilles suggested above.
>> But I could be very well confused...
> 
>  The 0x88/0x89 forms of the MOV instruction don't touch bytes outside of the
> operand size.

They do (if I am not confusing the opcodes) in the 32-bit destination register
case.  This is called implicit zero extension.  This is not documented in the
MOV instruction section (at least in the AMD manual), but it is documented in
appendix B.1 'General Rules for 64-Bit Mode':

Zero-Extension of 32-Bit Results: Operations on 32-bit operands in 64-bit mode
zero-extend the high 32 bits of 64-bit GPR destination registers.

8-bit/16-bit operations still have the historic semantics.
-- 
Andriy Gapon


More information about the svn-src-projects mailing list