| * This file has no copyright assigned and is placed in the Public Domain. |
| * This file is part of the mingw-w64 runtime package. |
| * No warranty is given; refer to the file DISCLAIMER.PD within this package. |
| /* GCC 11 has this as a macro. */ |
| /* Clang has support for MSVC builtins, GCC doesn't */ |
| #define __has_builtin(x) 0 |
| #if !__has_builtin(__rdtsc) |
| unsigned __int64 __rdtsc(void) |
| unsigned __int64 val1, val2; |
| : "=a" (val1), "=d" (val2)); |
| return ((unsigned __int64)val1) | (((unsigned __int64)val2) << 32); |