[PATCH 5/6] include: Add __rdtsc and __rdtscp intrinsics.

Jacek Caban jacek at codeweavers.com
Wed Mar 10 14:44:01 CST 2021


On 10.03.2021 17:13, Rémi Bernon wrote:
> Apparently clang >= 4.0.0 has __rdtsc (but not __rdtscp). Can we just 
> assume clang >= 4.0.0 is used and something like that would be 
> acceptable instead?


There is __has_builtin(), which would be cleaner in this case, IMHO.


Both compilers ship __rdtscp in ia32intrin.h header (gcc also __rdtscp, 
which clang doesn't need). I was considering something like this inside 
our intrin.h:


#if defined(__i386__) || defined(__x86_64__)

# include <x86intrin.h>

#endif


I believe that this should solve your problem. This rises some 
compatibility concerns, but I think it may be fine. It's shipped with 
compilers themselves for all platforms (not by mingw-w64).


Jacek




More information about the wine-devel mailing list