Skip to content

Commit

Permalink
Update to use the now legacy format by using llvm_asm
Browse files Browse the repository at this point in the history
  • Loading branch information
jlb6740 committed Jul 25, 2020
1 parent 7564a33 commit e8d61b3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/cpucounter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,13 @@ unsafe fn cpucounter() -> u64 {
(high << 32) | low
}


// https://github.com/google/benchmark/blob/v1.1.0/src/cycleclock.h#L116
#[cfg(asm)]
#[inline]
#[cfg(any(target_arch = "aarch64"))]
unsafe fn cpucounter() -> u64 {
let (vtm): (u64);
asm!("mrs %0, cntvct_el0" : "=r"(vtm));
llvm_asm!("mrs %0, cntvct_el0" : "=r"(vtm));
vtm
}

Expand Down

0 comments on commit e8d61b3

Please sign in to comment.