There was an error while loading. Please reload this page.
1 parent 893dccc commit 0902dfdCopy full SHA for 0902dfd
1 file changed
Python/ceval.c
@@ -65,9 +65,11 @@ ppc_getcounter(uint64 *v)
65
even in 64-bit mode, we need to use "a" and "d" for the lower and upper
66
32-bit pieces of the result. */
67
68
-#define READ_TIMESTAMP(val) \
69
- __asm__ __volatile__("rdtsc" : \
70
- "=a" (((int*)&(val))[0]), "=d" (((int*)&(val))[1]));
+#define READ_TIMESTAMP(val) do { \
+ unsigned int h, l; \
+ __asm__ __volatile__("rdtsc" : "=a" (l), "=d" (h)); \
71
+ (val) = ((uint64)l) | (((uint64)h) << 32); \
72
+ } while(0)
73
74
75
#else
0 commit comments