-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking Issue for CPUID target feature #146558
Copy link
Copy link
Closed as not planned
Labels
A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCO-x86_32Target: x86 processors, 32 bit (like i686-*) (also known as IA-32, i386, i586, i686)Target: x86 processors, 32 bit (like i686-*) (also known as IA-32, i386, i586, i686)O-x86_64Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCO-x86_32Target: x86 processors, 32 bit (like i686-*) (also known as IA-32, i386, i586, i686)Target: x86 processors, 32 bit (like i686-*) (also known as IA-32, i386, i586, i686)O-x86_64Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)Target: x86-64 processors (like x86_64-*) (also known as amd64 and x64)T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
The feature gate for the issue is
#![feature(cpuid_target_feature)].Motivation
The x86 CPUID instruction is extremely useful in determining what CPU features are available during runtime.
core::arch::x86::__cpuidand friends are a useful tool to call CPUID without writing the ASM yourself, but these are markedunsafe, and can't be made safe currently becausetarget_env = "sgx"doesn't support itSo, we introduce a detection-only (no codegen effects) target feature
cpuid, which will guard thecore::arch::x86::__cpuidfunction and friends. It is implied from all other x86 target features (except forsoft-float), so for most cases__cpuidwill be safe to call, and in general, users will be able to check if it is callable byis_x86_feature_detected!("cpuid").About tracking issues
Tracking issues are used to record the overall progress of implementation.
They are also used as hubs connecting to other relevant issues, e.g., bugs or open design questions.
A tracking issue is however not meant for large scale discussion, questions, or bug reports about a feature.
Instead, open a dedicated issue for the specific matter and add the relevant feature gate label.
Discussion comments will get marked as off-topic or deleted.
Repeated discussions on the tracking issue may lead to the tracking issue getting locked.
Steps
rustfmtUnresolved Questions
x87andsoft-floatimplycpuid?Implementation history
cpuidtarget feature #146560@rustbot label O-x86_32 O-x86_64 T-libs-api A-target-feature