Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 60b33cc

Browse files
committed
Merge 3.4 (ceval.c)
2 parents ee2b237 + 0b881dd commit 60b33cc

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

Python/ceval.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,11 @@ ppc_getcounter(uint64 *v)
6565
even in 64-bit mode, we need to use "a" and "d" for the lower and upper
6666
32-bit pieces of the result. */
6767

68-
#define READ_TIMESTAMP(val) \
69-
__asm__ __volatile__("rdtsc" : \
70-
"=a" (((int*)&(val))[0]), "=d" (((int*)&(val))[1]));
68+
#define READ_TIMESTAMP(val) do { \
69+
unsigned int h, l; \
70+
__asm__ __volatile__("rdtsc" : "=a" (l), "=d" (h)); \
71+
(val) = ((uint64)l) | (((uint64)h) << 32); \
72+
} while(0)
7173

7274

7375
#else

0 commit comments

Comments
 (0)