Skip to content

Commit 0aaa5ac

Browse files
committed
1 parent 027dcea commit 0aaa5ac

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/cpucounter.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
uint64_t cpucounter(void)
44
{
55
uint64_t low, high;
6-
__asm__ __volatile__ ("rdtscp" : "=a" (low), "=d" (high) : : "%ecx");
6+
__asm__ __volatile__("rdtscp"
7+
: "=a"(low), "=d"(high)
8+
:
9+
: "%ecx");
710
return (high << 32) | low;
811
}

src/cpucounter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ pub(crate) struct CPUCounter;
88
#[inline]
99
unsafe fn cpucounter() -> u64 {
1010
let (low, high): (u64, u64);
11-
llvm_asm!("rdtscp" : "={eax}" (low), "={edx}" (high) : : "ecx");
11+
asm!("rdtscp", out("eax") low, out("edx") high, out("ecx") _);
1212
(high << 32) | low
1313
}
1414

0 commit comments

Comments
 (0)