-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Tracking Issue for f16 and f128 float types #116909
Copy link
Copy link
Open
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.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 RFCF-f16_and_f128`#![feature(f16)]`, `#![feature(f128)]``#![feature(f16)]`, `#![feature(f128)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Metadata
Metadata
Assignees
Labels
B-RFC-approvedBlocker: Approved by a merged RFC but not yet implemented.Blocker: Approved by a merged RFC but not yet implemented.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 RFCF-f16_and_f128`#![feature(f16)]`, `#![feature(f128)]``#![feature(f16)]`, `#![feature(f128)]`T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Type
Fields
Give feedbackNo fields configured for issues without a type.
View all comments
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
Implementation history and Future Steps
f16andf128#121728f16andf128step 2: intrinsics #121841 (comment)f16andf128step 3: compiler support & feature gate #121926rustcmore or less expects for primitives Add basic trait impls forf16andf128#123085f16andf128to rustdoc'sPrimitiveType#123581Some parts are blocked on const eval, compiler builtins updates, and LLVM lowering bugs.hooray, this part is done!f16andf128step 4: basic library support #122470Debugimpl and some basic functions tof16andf128#123783f16andf128#126608f16andf128math functions #127027f16/f128float conversions compiler-builtins#593f128compiler-builtins#606f128float to integer conversion functions compiler-builtins#613__divtf3compiler-builtins#622__powitf2symbol forf128integer exponentiation compiler-builtins#614test-float-parsein Rust #127510f16, which should be straightforward Addf16formatting and parsing #127013f128which will not be straightforward. Our current implementations are prettyu64-dependent so they can't fit af128mantissa. We could make them generic but probably want to instead use an implementation that is slower but better for size.f16andf128const eval for binary and unary operationations #126429f16andf128#127032f16shims addf16support miri#4895f128shims (partially implemented by implement sqrt and add fixme forf128miri#4902)Add encoding forAdd v0 symbol mangling forf16andf128#122106f16andf128#123816Ensure known demanglers get updated or at least have issues for adding the new typesunneeded with the forward-compatible demanglingf16andf128in assembly on platforms that support it #125398f16andf128inline ASM support foraarch64#129536f16andf128inline ASM support forx86andx86-64#126417f16inline ASM support for RISC-V #126530f16inline ASM support for 32-bit ARM #126555f128and validate that it works correctlyf128(but only of 8 fori128)f16andf128rustc_codegen_gcc#461f16andf128rustc_codegen_cranelift#1461unimplementeds andFIXMEs are removed from tools that need library supportf16andf128unimplemented!/FIXMEs #126636f16andf128pattern matching stubs with real implementations #123088f16/f128FIXMEs that needed(NEG_)INFINITY#127496f16_nanAddf16andf128toinvalid_nan_comparison#132439f16_epsilonfor Clippy (needs to be added)f16generates code that uses the incorrect ABI for compiler-rt #123885halfoperations by using too much precision on several backends llvm/llvm-project#97975 LLVM miscompiles passing/returninghalfon several backends by using lossy conversions llvm/llvm-project#97981@llvm.fabs.f16generates call to__extendhfsf2llvm/llvm-project#104915 (comment)f128symbols on powerpc64 give inaccurate results #125109f128from_bits/to_bitssometimes gets reversed on ppc #125102f128 as f16casting bug LLVM f128 -> f16 conversion selection failure on powerpc64le llvm/llvm-project#92866fp128->halfuses__trunctfhf2but should be__trunckfhf2llvm/llvm-project#98126+fand+dllvm/llvm-project#93894 (fixed upstream)f128Can't pass or returnhalforfp128onarm64ecllvm/llvm-project#94434 (f16supported since [Arm64EC] Add support forhalfllvm/llvm-project#152843)-fp-armv8crash usingselectwithhalfllvm/llvm-project#129394wasm32,halfoperation results aren't correctly rounded between each operation llvm/llvm-project#96437fp128causes compilation failures when compiling fornvptx64-nvidia-cudallvm/llvm-project#95471f128Compiler crash when targetingmips64when returningfp128after calling a function returning{ i8, i128 }llvm/llvm-project#96432powerpc64-ibm-aixdoesn't currently supportf128arguments:fp128arguments cause a compiler error onpowerpc64-ibm-aixllvm/llvm-project#101545-Ctarget-feature#116344 (and in particular Figure out which target features are required/incompatible for which ABI #131799) for all targets; those issues are mostly focusing on f32 and f64 so there might be more target features we have to worry about for f16/f128 (see f16 and f128 have non-trivial ABI requirements on some targets #138616)minimumandmaximumdon't work on x86 and aarch64 [aarch64]Cannot select: constant:i128<0>forllvm.maximum.f128llvm/llvm-project#139380 [x86]: Cannot select:constant:i128<0>forllvm.maximum.f128llvm/llvm-project#139381 (nonblocking as we are using the fallback for now)fma.f16incorrectlyllvm.fma.f16intrinsic is expanded incorrectly on targets without nativehalfFMA support llvm/llvm-project#98389powi.f16constant folding returns incorrect values Misoptimization:EarlyCSEPassuses replacespowi.f16withfloatresult llvm/llvm-project#98665cfgthat lets us gate tests based on backend support Implement the internal featurecfg_target_has_reliable_f16_f128#140323Note that
// FIXME(f128)/// FIXME(f16)/// FIXME(f16,f128)andunimplemented!("f16_f128")are being used where relevant, to make the todo list easily greppable.Nice to have changes:
f16: Add Natvis visualiser and debuginfo tests forf16#127001f128f16andf128support (add toFloatTy) rust-analyzer#17451f16andf128under a nightly flag Lokathor/bytemuck#250