From owner-svn-src-projects@FreeBSD.ORG Wed Oct 24 06:24:07 2012 Return-Path: Delivered-To: svn-src-projects@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 952E7F41; Wed, 24 Oct 2012 06:24:07 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citadel.icyb.net.ua (citadel.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 71AB08FC0C; Wed, 24 Oct 2012 06:24:06 +0000 (UTC) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citadel.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id JAA21222; Wed, 24 Oct 2012 09:24:04 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1TQuNo-000Hjr-8p; Wed, 24 Oct 2012 09:24:04 +0300 Message-ID: <50878982.8090604@FreeBSD.org> Date: Wed, 24 Oct 2012 09:24:02 +0300 From: Andriy Gapon User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:16.0) Gecko/20121013 Thunderbird/16.0.1 MIME-Version: 1.0 To: Peter Grehan Subject: Re: svn commit: r241744 - projects/bhyve/usr.sbin/bhyve References: <201210191811.q9JIBIQu049356@svn.freebsd.org> <20121021121006.GA96141@stack.nl> <5085D433.4020101@freebsd.org> <20121023095549.GA27951@stack.nl> <5086C976.9060705@freebsd.org> <5086D040.1090307@FreeBSD.org> <50877F67.1040409@freebsd.org> In-Reply-To: <50877F67.1040409@freebsd.org> X-Enigmail-Version: 1.4.5 Mail-Followup-To: Peter Grehan , Jilles Tjoelker , src-committers@freebsd.org, svn-src-projects@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: svn-src-projects@FreeBSD.org, src-committers@FreeBSD.org, Jilles Tjoelker X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 24 Oct 2012 06:24:07 -0000 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