svn commit: r395648 - head/graphics/appleseed/files
Alexey Dokuchaev
danfe at FreeBSD.org
Mon Aug 31 09:45:32 UTC 2015
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 <danfe at FreeBSD.org> 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
More information about the svn-ports-head
mailing list