Skip to content

Sync from rust 2025/05/12 #673

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 17 commits into from
May 14, 2025
Merged

Sync from rust 2025/05/12 #673

merged 17 commits into from
May 14, 2025

Conversation

antoyo
Copy link
Contributor

@antoyo antoyo commented May 12, 2025

No description provided.

bjorn3 and others added 14 commits April 14, 2025 09:38
Support for `f16` and `f128` is varied across targets, backends, and
backend versions. Eventually we would like to reach a point where all
backends support these approximately equally, but until then we have to
work around some of these nuances of support being observable.

Introduce the `cfg_target_has_reliable_f16_f128` internal feature, which
provides the following new configuration gates:

* `cfg(target_has_reliable_f16)`
* `cfg(target_has_reliable_f16_math)`
* `cfg(target_has_reliable_f128)`
* `cfg(target_has_reliable_f128_math)`

`reliable_f16` and `reliable_f128` indicate that basic arithmetic for
the type works correctly. The `_math` versions indicate that anything
relying on `libm` works correctly, since sometimes this hits a separate
class of codegen bugs.

These options match configuration set by the build script at [1]. The
logic for LLVM support is duplicated as-is from the same script. There
are a few possible updates that will come as a follow up.

The config introduced here is not planned to ever become stable, it is
only intended to replace the build scripts for `std` tests and
`compiler-builtins` that don't have any way to configure based on the
codegen backend.

MCP: rust-lang/compiler-team#866
Closes: rust-lang/compiler-team#866

[1]: https://github.com/rust-lang/rust/blob/555e1d0386f024a8359645c3217f4b3eae9be042/library/std/build.rs#L84-L186
Share the naked asm impl between cg_ssa and cg_clif

This was introduced in rust-lang/rust#128004.
remove 'unordered' atomic intrinsics

As their doc comment already indicates, these operations do not currently have a place in our memory model. The intrinsics were introduced to support a hack in compiler-builtins, but that hack recently got removed (see rust-lang/compiler-builtins#788).
…m,traviscross,tgross35

Use intrinsics for `{f16,f32,f64,f128}::{minimum,maximum}` operations

This PR creates intrinsics for `{f16,f32,f64,f64}::{minimum,maximum}` operations.

This wasn't done when those operations were added as the LLVM support was too weak but now that LLVM has libcalls for unsupported platforms we can finally use them.

Cranelift and GCC[^1] support are partial, Cranelift doesn't support `f16` and `f128`, while GCC doesn't support `f16`.

r? `@tgross35`

try-job: aarch64-gnu
try-job: dist-various-1
try-job: dist-various-2

[^1]: https://www.gnu.org/software///gnulib/manual/html_node/Functions-in-_003cmath_002eh_003e.html
@antoyo antoyo force-pushed the sync_from_rust_2025_05_12 branch 2 times, most recently from d7698e6 to 658b0a4 Compare May 12, 2025 16:00
@antoyo antoyo force-pushed the sync_from_rust_2025_05_12 branch from 658b0a4 to e8b0759 Compare May 14, 2025 09:00
@antoyo antoyo force-pushed the sync_from_rust_2025_05_12 branch from e8b0759 to f38d6d0 Compare May 14, 2025 09:18
@antoyo antoyo merged commit 6ba33f5 into master May 14, 2025
37 checks passed
@antoyo antoyo deleted the sync_from_rust_2025_05_12 branch May 14, 2025 10:00
@antoyo antoyo mentioned this pull request May 14, 2025
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.

9 participants