Skip to content

Finish removing has_cpuid #128528

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions library/std/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -269,10 +269,6 @@
#![cfg_attr(any(windows, target_os = "uefi"), feature(round_char_boundary))]
#![cfg_attr(target_family = "wasm", feature(stdarch_wasm_atomic_wait))]
#![cfg_attr(target_arch = "wasm64", feature(simd_wasm64))]
#![cfg_attr(
all(any(target_arch = "x86_64", target_arch = "x86"), target_os = "uefi"),
feature(stdarch_x86_has_cpuid)
)]
//
// Language features:
// tidy-alphabetical-start
Expand Down
8 changes: 0 additions & 8 deletions library/std/src/sys/pal/uefi/time.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,10 +175,6 @@ pub(crate) mod instant_internal {

#[cfg(target_arch = "x86_64")]
fn timestamp_rdtsc() -> Option<Duration> {
if !crate::arch::x86_64::has_cpuid() {
return None;
}

static FREQUENCY: crate::sync::OnceLock<u64> = crate::sync::OnceLock::new();

// Get Frequency in Mhz
Expand All @@ -200,10 +196,6 @@ pub(crate) mod instant_internal {

#[cfg(target_arch = "x86")]
fn timestamp_rdtsc() -> Option<Duration> {
if !crate::arch::x86::has_cpuid() {
return None;
}

static FREQUENCY: crate::sync::OnceLock<u64> = crate::sync::OnceLock::new();

let freq = FREQUENCY
Expand Down
9 changes: 0 additions & 9 deletions src/tools/rustfmt/tests/source/cfg_if/detect/os/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ pub fn check_for(x: Feature) -> bool {
fn detect_features() -> cache::Initializer {
let mut value = cache::Initializer::default();

// If the x86 CPU does not support the CPUID instruction then it is too
// old to support any of the currently-detectable features.
if !has_cpuid() {
return value;
}

// Calling `__cpuid`/`__cpuid_count` from here on is safe because the CPU
// has `cpuid` support.

// 0. EAX = 0: Basic Information:
// - EAX returns the "Highest Function Parameter", that is, the maximum
// leaf value for subsequent calls of `cpuinfo` in range [0,
Expand Down
9 changes: 0 additions & 9 deletions src/tools/rustfmt/tests/target/cfg_if/detect/os/x86.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,15 +34,6 @@ pub fn check_for(x: Feature) -> bool {
fn detect_features() -> cache::Initializer {
let mut value = cache::Initializer::default();

// If the x86 CPU does not support the CPUID instruction then it is too
// old to support any of the currently-detectable features.
if !has_cpuid() {
return value;
}

// Calling `__cpuid`/`__cpuid_count` from here on is safe because the CPU
// has `cpuid` support.

// 0. EAX = 0: Basic Information:
// - EAX returns the "Highest Function Parameter", that is, the maximum
// leaf value for subsequent calls of `cpuinfo` in range [0,
Expand Down
Loading