Boost logo

Boost :

Subject: Re: [boost] [random] parallel random number generators
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2012-01-29 19:22:38


On 01/29/2012 10:53 PM, John Salmon wrote:

>> You're correct. I mistakenly assumed that you couldn't use AESNI
> instructions in 32-bit code. I'm not sure why anyone would want to, but it
> *is* possible. I'll add the code to push and pop %ebx around cpuid.

The definition of cpuid I personally use is

#if !defined(__PIC__) || defined(__x86_64__)
     __asm__ __volatile__
     (
       "cpuid"
     : "=a" (CPUInfo[eax]), "=b" (CPUInfo[ebx])
     , "=c" (CPUInfo[ecx]), "=d" (CPUInfo[edx])
     : "a" (InfoType)
     : "cc"
     );
#else
     __asm__ __volatile__
     (
       "pushl %%ebx \n\t" /* save %ebx */
       "cpuid \n\t"
       "movl %%ebx, %1 \n\t" /* save what cpuid just put in %ebx */
       "popl %%ebx \n\t" /* restore the old %ebx */
     : "=a"(CPUInfo[eax]), "=r"(CPUInfo[ebx])
     , "=c"(CPUInfo[ecx]), "=d"(CPUInfo[edx])
     : "a"(InfoType)
     : "cc"
     );
#endif


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk