Skip to content

Commit 9b52479

Browse files
committed
asm!() -> llvm_asm!()
1 parent f0b5093 commit 9b52479

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/cpucounter.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
use super::timestamp::*;
2+
#[cfg(asm)]
3+
use std::llvm_asm;
24

35
pub(crate) struct CPUCounter;
46

57
#[cfg(asm)]
68
#[inline]
79
unsafe fn cpucounter() -> u64 {
810
let (low, high): (u64, u64);
9-
asm!("rdtscp" : "={eax}" (low), "={edx}" (high) : : "ecx");
11+
llvm_asm!("rdtscp" : "={eax}" (low), "={edx}" (high) : : "ecx");
1012
(high << 32) | low
1113
}
1214

src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#![cfg_attr(asm, feature(asm))]
1+
#![cfg_attr(asm, feature(llvm_asm))]
22

33
//! Precision is a simple crate to perform measurements using hardware counters.
44
//!

src/precision.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ impl Precision {
4343

4444
#[cfg(any(target_os = "macos", target_os = "freebsd"))]
4545
fn guess_frequency_using_sysctl(name: &str) -> Result<u64, &'static str> {
46-
use libc::{self, c_long, size_t};
46+
use libc::{c_long, size_t};
4747
use std::ffi::CString;
4848
use std::mem;
4949
use std::ptr;

0 commit comments

Comments
 (0)