Use the new definition of rdtscp intrinsic

- add `-Zverify-llvm-ir` in testsuite
This commit is contained in:
sayantn
2025-05-28 02:08:46 +05:30
committed by Amanieu d'Antras
parent 28960ece72
commit 3de76d47a2
2 changed files with 6 additions and 4 deletions

View File

@@ -46,15 +46,17 @@ pub unsafe fn _rdtsc() -> u64 {
#[cfg_attr(test, assert_instr(rdtscp))]
#[stable(feature = "simd_x86", since = "1.27.0")]
pub unsafe fn __rdtscp(aux: *mut u32) -> u64 {
rdtscp(aux as *mut _)
let (tsc, auxval) = rdtscp();
*aux = auxval;
tsc
}
#[allow(improper_ctypes)]
unsafe extern "C" {
unsafe extern "unadjusted" {
#[link_name = "llvm.x86.rdtsc"]
fn rdtsc() -> u64;
#[link_name = "llvm.x86.rdtscp"]
fn rdtscp(aux: *mut u8) -> u64;
fn rdtscp() -> (u64, u32);
}
#[cfg(test)]