|
Lines 1-11
Link Here
|
| 1 |
--- src/smack1.c.orig 2017-06-06 03:59:39 UTC |
1 |
--- src/smack1.c.orig 2021-01-31 09:13:30 UTC |
| 2 |
+++ src/smack1.c |
2 |
+++ src/smack1.c |
| 3 |
@@ -115,6 +115,8 @@ |
3 |
@@ -119,8 +119,7 @@ |
| 4 |
#include "pixie-timer.h" |
4 |
#elif defined(__FreeBSD__) |
| 5 |
#if defined(_MSC_VER) |
5 |
#include <sys/types.h> |
| 6 |
#include <intrin.h> |
6 |
#include <machine/cpufunc.h> |
| 7 |
+#elif defined(__llvm__) && (defined(__amd64__) || defined(__i386__)) |
7 |
-#define __rdtsc rdtsc |
| 8 |
+#include <x86intrin.h> |
8 |
-#if (__ARM_ARCH >= 6) // V6 is the earliest arch that has a standard cyclecount |
| 9 |
#elif defined(__GNUC__) |
9 |
+#if (__ARM_ARCH >= 6 && __ARM_ARCH <= 7) // V6 is the earliest arch that has a standard cyclecount |
| 10 |
static __inline__ unsigned long long __rdtsc(void) |
10 |
unsigned long long rdtsc(void) |
| 11 |
{ |
11 |
{ |
|
|
12 |
uint32_t pmccntr; |
| 13 |
@@ -138,6 +137,10 @@ unsigned long long rdtsc(void) |
| 14 |
} |
| 15 |
return 0; |
| 16 |
} |
| 17 |
+#elif defined(__aarch64__) |
| 18 |
+#define __rdtsc() 0 |
| 19 |
+#else |
| 20 |
+#define __rdtsc rdtsc |
| 21 |
#endif |
| 22 |
#elif defined (__llvm__) |
| 23 |
#if defined(i386) || defined(__i386__) |