From 6ac95f9a0021636de012e944c75fb32f3df6c199 Mon Sep 17 00:00:00 2001 From: Johnnie Birch <45402135+jlb6740@users.noreply.github.com> Date: Fri, 24 Jul 2020 17:57:57 -0700 Subject: [PATCH] Update to use the now legacy format by using llvm_asm https://github.com/rust-lang/rfcs/blob/master/text/2843-llvm-asm.md https://github.com/rust-lang/rfcs/pull/2873 --- src/cpucounter.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpucounter.rs b/src/cpucounter.rs index cc0997e..7cb0203 100644 --- a/src/cpucounter.rs +++ b/src/cpucounter.rs @@ -1,3 +1,4 @@ +#![feature(llvm_asm)] use super::timestamp::*; pub(crate) struct CPUCounter; @@ -10,14 +11,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 }