Use the new definition of rdtscp intrinsic
- add `-Zverify-llvm-ir` in testsuite
This commit is contained in:
committed by
Amanieu d'Antras
parent
28960ece72
commit
3de76d47a2
@@ -10,7 +10,7 @@ set -ex
|
|||||||
#export RUST_TEST_NOCAPTURE=1
|
#export RUST_TEST_NOCAPTURE=1
|
||||||
#export RUST_TEST_THREADS=1
|
#export RUST_TEST_THREADS=1
|
||||||
|
|
||||||
export RUSTFLAGS="${RUSTFLAGS} -D warnings -Z merge-functions=disabled "
|
export RUSTFLAGS="${RUSTFLAGS} -D warnings -Z merge-functions=disabled -Z verify-llvm-ir"
|
||||||
export HOST_RUSTFLAGS="${RUSTFLAGS}"
|
export HOST_RUSTFLAGS="${RUSTFLAGS}"
|
||||||
export PROFILE="${PROFILE:="--profile=release"}"
|
export PROFILE="${PROFILE:="--profile=release"}"
|
||||||
|
|
||||||
|
|||||||
@@ -46,15 +46,17 @@ pub unsafe fn _rdtsc() -> u64 {
|
|||||||
#[cfg_attr(test, assert_instr(rdtscp))]
|
#[cfg_attr(test, assert_instr(rdtscp))]
|
||||||
#[stable(feature = "simd_x86", since = "1.27.0")]
|
#[stable(feature = "simd_x86", since = "1.27.0")]
|
||||||
pub unsafe fn __rdtscp(aux: *mut u32) -> u64 {
|
pub unsafe fn __rdtscp(aux: *mut u32) -> u64 {
|
||||||
rdtscp(aux as *mut _)
|
let (tsc, auxval) = rdtscp();
|
||||||
|
*aux = auxval;
|
||||||
|
tsc
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(improper_ctypes)]
|
#[allow(improper_ctypes)]
|
||||||
unsafe extern "C" {
|
unsafe extern "unadjusted" {
|
||||||
#[link_name = "llvm.x86.rdtsc"]
|
#[link_name = "llvm.x86.rdtsc"]
|
||||||
fn rdtsc() -> u64;
|
fn rdtsc() -> u64;
|
||||||
#[link_name = "llvm.x86.rdtscp"]
|
#[link_name = "llvm.x86.rdtscp"]
|
||||||
fn rdtscp(aux: *mut u8) -> u64;
|
fn rdtscp() -> (u64, u32);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
Reference in New Issue
Block a user