-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Implement the internal feature cfg_target_has_reliable_f16_f128
#140323
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -235,6 +235,24 @@ pub struct CrateInfo { | |
pub lint_levels: CodegenLintLevels, | ||
} | ||
|
||
/// Target-specific options that get set in `cfg(...)`. | ||
/// | ||
/// RUSTC_SPECIFIC_FEATURES should be skipped here, those are handled outside codegen. | ||
pub struct TargetConfig { | ||
/// Options to be set in `cfg(target_features)`. | ||
pub target_features: Vec<Symbol>, | ||
/// Options to be set in `cfg(target_features)`, but including unstable features. | ||
pub unstable_target_features: Vec<Symbol>, | ||
/// Option for `cfg(target_has_reliable_f16)`, true if `f16` basic arithmetic works. | ||
pub has_reliable_f16: bool, | ||
/// Option for `cfg(target_has_reliable_f16_math)`, true if `f16` math calls work. | ||
pub has_reliable_f16_math: bool, | ||
/// Option for `cfg(target_has_reliable_f128)`, true if `f128` basic arithmetic works. | ||
pub has_reliable_f128: bool, | ||
/// Option for `cfg(target_has_reliable_f128_math)`, true if `f128` math calls work. | ||
pub has_reliable_f128_math: bool, | ||
Comment on lines
+246
to
+253
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reliability of f16/f128 is not related to target features. I wonder if we could come up with a better name of the query (and this struct). Maybe simply There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fair point, this doesn't really directly affect codegen so I went with |
||
} | ||
|
||
#[derive(Encodable, Decodable)] | ||
pub struct CodegenResults { | ||
pub modules: Vec<CompiledModule>, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Miri is no longer tested here, were the intrinsics ever implemented? or do we have a different mechanism for Miri?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe they are still unimplemented but I haven't checked in a while (I assume this would be updated if they were added). But that should probably be done separately even if it works now, so I have just been replacing the existing
cfg(reliable_f16_math)
with#[cfg(not(miri))]
and#[cfg(target_has_reliable_f16)]
.I did forget to include
cfg(not(miri))
on the library doctests though, fixed that now.