From owner-svn-ports-all@freebsd.org Mon Aug 31 09:45:32 2015 Return-Path: Delivered-To: svn-ports-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 0DBFD9C6541; Mon, 31 Aug 2015 09:45:32 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:1900:2254:206c::16:87]) by mx1.freebsd.org (Postfix) with ESMTP id 00F0C17FC; Mon, 31 Aug 2015 09:45:32 +0000 (UTC) (envelope-from danfe@freebsd.org) Received: by freefall.freebsd.org (Postfix, from userid 1033) id 006E01DCB; Mon, 31 Aug 2015 09:45:32 +0000 (UTC) Date: Mon, 31 Aug 2015 09:45:31 +0000 From: Alexey Dokuchaev To: Tijl Coosemans Cc: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: Re: svn commit: r395648 - head/graphics/appleseed/files Message-ID: <20150831094531.GA25459@FreeBSD.org> References: <201508310442.t7V4gxnm038292@repo.freebsd.org> <20150831101421.4a9f0528@kalimero.tijl.coosemans.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150831101421.4a9f0528@kalimero.tijl.coosemans.org> User-Agent: Mutt/1.5.23 (2014-03-12) X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 31 Aug 2015 09:45:32 -0000 On Mon, Aug 31, 2015 at 10:14:21AM +0200, Tijl Coosemans wrote: > On Mon, 31 Aug 2015 04:42:59 +0000 (UTC) Alexey Dokuchaev wrote: > > Author: danfe > > Date: Mon Aug 31 04:42:58 2015 > > New Revision: 395648 > > URL: https://svnweb.freebsd.org/changeset/ports/395648 > > > > Log: > > - Use %edi register to save/restore contents of %ebx instead of pushing > > it on stack to make the code work for both 32/64-bit x86 > > - Make the corresponding comment more accurate while I'm at it > > [...] > > You can simply use: > > asm("cpuid" : "+a" (data[eax]), "=b" (data[ebx]), > "+c" (data[ecx]), "=d" (data[edx])); > > The compiler will preserve any registers if necessary. It might have > saved ebx somewhere already for some other reason. Thanks Tijl, your version looks definitely cleaner! > Also, for cpuid eax and ecx are intput/output and ebx and edx are > output only. Yeah, I was suspecting it, but was too lazy to dig up the manual again. ./danfe