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

Jacek Caban jacek at codeweavers.com
Thu Mar 11 14:23:46 CST 2021


On 11.03.2021 11:47, Rémi Bernon wrote:
> On 3/10/21 10:20 PM, Rémi Bernon wrote:
>> On 3/10/21 9:44 PM, Jacek Caban wrote:
>>> 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
>>>
>>
>> Ah yes sure, I didn't know these were available in intel intrinsic 
>> headers. I guess that would be perfect then.
>
> Except that it has some conflicts with msvcrt _(l)rot[r|l] functions 
> in stdlib.h. Can we remove the definitions from there?


#undefs, like in the attached patch, seem to be enough.


Jacek

-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch.diff
Type: text/x-patch
Size: 1229 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20210311/8d16d715/attachment.bin>


More information about the wine-devel mailing list