On 02/10/2014 03:35 PM, Jeffrey Walton wrote:
> I've got some code that determines CPU capabilities for x86
> processors. I'm interested in RDRAND and AESNI, and I use three
> functions to determine the capabilities: HasIntel(), HasAESNI() and
> HasRDRAND().
> 
> Debug configurations compiled with GCC and Clang work fine. Release
> configuration compiled with GCC and Clang work fine.
> 
> However, I get *one* incorrect result when running under Valgrind. The
> incorrect result is from HasRDRAND(). Under Valgrind, the result is 0,
> which means RDRAND is not available.

Valgrind deliberately "fakes" the results of CPUID so that the bits
reflect the virtual machine that valgrind knows how to support.
Valgrind does not know how to implement RDRAND.
[Only Intel and very few others know *exactly* what RDRAND does.]
A quick search of the web for "valgrind CPUID" will fill in the details.
It's even documented: search for 'CPUID' or 'SSE2' in and below
the docs/ directory of the source tree.

-- 


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Valgrind-users mailing list
Valgrind-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/valgrind-users

Reply via email to