Skip to content

Use the compiler to determine whether or not to enable f16 and f128 #963

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
merged 1 commit into from
Jul 2, 2025

Conversation

tgross35
Copy link
Contributor

@tgross35 tgross35 commented Jun 30, 2025

Currently we whether or not to build and test f16 and f128 support
mostly based on the target triple. This isn't always accurate, however,
since support also varies by backend and the backend version.

Since recently, rustc is aware of this with the unstable config option
target_has_reliable_{f16,f128}, which better represents when the types
are actually expected to be available and usable. Switch our
compiler-builtins and libm configuration to use this by probing rustc
for the target's settings.

A few small cfg fixes are needed with this.

@tgross35 tgross35 force-pushed the f16-f128-enabled-cfg branch 7 times, most recently from 0fd2c46 to f9f1204 Compare July 1, 2025 07:23
@tgross35 tgross35 marked this pull request as ready for review July 1, 2025 07:24
@tgross35 tgross35 requested a review from Amanieu July 1, 2025 07:24
Currently we whether or not to build and test `f16` and `f128` support
mostly based on the target triple. This isn't always accurate, however,
since support also varies by backend and the backend version.

Since recently, `rustc` is aware of this with the unstable config option
`target_has_reliable_{f16,f128}`, which better represents when the types
are actually expected to be available and usable. Switch our
compiler-builtins and libm configuration to use this by probing `rustc`
for the target's settings.

A few small `cfg` fixes are needed with this.
@tgross35 tgross35 force-pushed the f16-f128-enabled-cfg branch from f9f1204 to ed17b95 Compare July 2, 2025 06:19
@tgross35 tgross35 merged commit ed17b95 into rust-lang:master Jul 2, 2025
35 checks passed
@tgross35 tgross35 deleted the f16-f128-enabled-cfg branch July 2, 2025 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants