Open traviscross opened 9 months ago
@rustbot labels +T-lang
@rustbot labels +B-rfc-approved
WIP implementation: https://github.com/rust-lang/rust/pull/114607
@rustbot claim
@rustbot release-assignment
@rustbot prioritize
@rustbot ping types
@rustbot label: +T-compiler
This is a tracking issue and doesn't need prioritization.
A blocking issue should be added: ensure C compatibility with ABI-cafe or similar
https://github.com/rust-lang/rust/pull/114607#discussion_r1421042343
Implementation steps (could somebody link this in the top post?):
rustc
more or less expects for primitives https://github.com/rust-lang/rust/pull/123085unimplemented
s and FIXME
s are removed from tools that need library support
f16_nan
f128 as f16
casting bug https://github.com/llvm/llvm-project/issues/92866f128
https://github.com/llvm/llvm-project/issues/96432fma.f16
incorrectly https://github.com/llvm/llvm-project/issues/98389powi.f16
constant folding returns incorrect values https://github.com/llvm/llvm-project/issues/98665
https://github.com/llvm/llvm-project/issues/41838This is based on the suggested pattern at https://github.com/rust-lang/rust/pull/120645#issuecomment-1925900572. I have a more complete reference PR with most of these done at https://github.com/rust-lang/rust/pull/114607
I am trying to consistently use unimplemented!("f16_f128")
and // FIXME(f16_f128)
to make needed changes easily greppable.
Nice to have changes:
f16
: https://github.com/rust-lang/rust/pull/127001f128
@rustbot claim
@tgross35 we (rizinorg) have merged the changes on our demangling library. i have added also some tests https://github.com/rizinorg/rz-libdemangle/blob/main/test/test_rust.c#L75-L78
@tgross35 we (rizinorg) have merged the changes on our demangling library. i have added also some tests https://github.com/rizinorg/rz-libdemangle/blob/main/test/test_rust.c#L75-L78
That was super fast :) the update is much appreciated.
Note that the mangling isn't actually finalized but does seem reasonably likely to merge as-is https://github.com/rust-lang/rust/pull/122106
i don't think that will be a big issue. i can always fix this once is merged if it ever changes.
@wargio https://github.com/rust-lang/rust/pull/122106 wound up being closed in favor of C3f16
and C4f128
(https://github.com/rust-lang/rust/pull/123816), which should already demangle correctly. So I think you should be able to revert the addition. Sorry for the noise!
@tgross35 i will. i read about the decision yesterday, so for me is just a couple of lines that needs to be removed. thank you for your wonderful work!
arm64ec-pc-windows-msvc
can't compile functions that pass or return f16
or f128
due to llvm/llvm-project#94434.
More LLVM bugs:
s390x-unknown-linux-gnu
doesn't support f16
: llvm/llvm-project#50374nvptx64-nvidia-cuda
doesn't support f128
: llvm/llvm-project#95471sparc-unknown-linux-gnu
doesn't support passing f128
directly (error message SPARCv8 does not handle f128 in calls; pass indirectly
): llvm/llvm-project#4183864-bit MIPS targets (all tier 3) have a bug involving f128
that prevents compilation of compiler-builtins
in debug mode without the no-f16-f128
feature: llvm/llvm-project#96432
wasm32
(tier 2) has f16
bugs with failing to round in-between operations (llvm/llvm-project#96437) and quietening signalling NaNs in some situations when passing to and returning from a function (llvm/llvm-project#96438).
It seems the LLVM f16
excess precision and ABI-handling bugs aren't limited to WASM:
The list of affected LLVM backends is included in each issue: both affect tier 2 and tier 3 Rust targets.
The test suite currently fails on s390x in the following doctests:
library/core/src/num/f16.rs - f16::f16::is_sign_negative (line 377)
library/core/src/num/f16.rs - f16::f16::is_sign_positive (line 354)
library/core/src/num/f16.rs - f16::f16::to_be_bytes (line 695)
library/core/src/num/f16.rs - f16::f16::to_le_bytes (line 716)
library/core/src/num/f16.rs - f16::f16::to_ne_bytes (line 743)
due to
rustc-LLVM ERROR: Cannot select: 0x3ffcc0737a0: i32 = fp_to_fp16 0x3ffcc072fc0
(which is https://github.com/llvm/llvm-project/issues/50374)
After https://github.com/rust-lang/rust/pull/127235 most doctests are already restricted to x64_64 (or aarch64), but these few listed above remain active on all Linux platforms. Could those also be restricted for now (until the s390x LLVM back-end is fixed) so that the test suite passes again? Thanks!
Thanks for reporting @uweigand, yes those could be restricted too. Feel free to open a PR similar to #127235 if you're up for it, otherwise I'll try to put one up in the next couple days.
Thanks for reporting @uweigand, yes those could be restricted too. Feel free to open a PR similar to #127235 if you're up for it, otherwise I'll try to put one up in the next couple days.
I've now opened https://github.com/rust-lang/rust/pull/127588, thanks!
LLVM lowers f16
FMA incorrectly on targets without native f16
FMA support (so this will affect most targets including all tier 1 targets): llvm/llvm-project#98389
It appears that today f128
doesn't trigger the incomplete_features lint: https://play.rust-lang.org/?version=nightly&mode=release&edition=2021&gist=9d8a3698d5d506fc960bde270e9a1a54
It might be a good idea to do that for now, to avoid people making threads like https://users.rust-lang.org/t/display-for-f128/114405?u=scottmcm
This is a tracking issue for the RFC 3453 (rust-lang/rfcs#3453).
The feature gate for the issue is
#![feature(f16_and_f128)]
.From the RFC:
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.
Steps
Unresolved questions
None so far.
Implementation history
121728