rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
93.58k stars 12.05k forks source link

Document That `f16` And `f128` Hardware Support is Limited (v2) #124750

Closed dtolnay closed 1 week ago

dtolnay commented 1 week ago

This PR is identical to #123892, which was approved and merged but then removed from master by a force-push due to a CI bug.

r? ghost

Original PR description:


This adds a small paragraph to the recently added f16 and f128 types explaining that hardware support may be limited, and that performance may suffer as a result of that.

I mainly wrote this because I felt it may be useful to express in some form; as a launchpoint for readers of the documentation if they have issues with performance.

I tried to word the documentation in a way that doesn't create false assumptions (that f16/f128 is too slow to use, for instance), removing the software implementation part could mislead people to thinking that f16/f128 is only available on some platforms, not all, so I believe it is important to keep in.\ "not all major platforms" is specifically said so as to not be redundant, because not all platforms implement many things, but the average rustacean is probably going to be using x86_64 or aarch64 derived ISA's, which is who this documentation is targeted towards.

I'm not sure of the best way to word the documentation, or if it should even be added, but I feel like it may be useful to have (potentially in a reworded way, I'm not very confident in the current wording and cannot decide if that is because it is too vague to be useful or too specific to be generally correct).

dtolnay commented 1 week ago

@bors r=workingjubilee

bors commented 1 week ago

:pushpin: Commit 5aa2f9a208162389a743c45cebb72a994effca1c has been approved by workingjubilee

It is now in the queue for this repository.