Add f16 formatting and parsing#127013
Conversation
This comment has been minimized.
This comment has been minimized.
|
@rustbot label +rla-silenced |
|
@rustbot label +F-f16_and_f128 |
|
This will need #127510 |
|
☔ The latest upstream changes (presumably #127020) made this pull request unmergeable. Please resolve the merge conflicts. |
7c3f9c1 to
f3ebeb3
Compare
|
Update: I'm really just waiting on #128083 to bump stage0, managing |
|
☔ The latest upstream changes (presumably #128360) made this pull request unmergeable. Please resolve the merge conflicts. |
2eaa479 to
422c52e
Compare
21ffabc to
2098f01
Compare
404089f to
3636530
Compare
|
@Mark-Simulacrum the only thing that changed from the original approval should be the addition of the fallback. I double checked with Bjorn and there shouldn’t be any problems with that. @rustbot ready |
library/core/src/num/dec2flt/mod.rs
Outdated
| // FIXME(f16_f128): A fallback is used when the backend+target does not support f16 well, in order | ||
| // to avoid ICEs. | ||
|
|
||
| // After the bootstrap bump this should be: `#[cfg(not(target_has_reliable_f16))` |
There was a problem hiding this comment.
If true, please write this as a pair of cfg_attrs not a comment - we have some partial automation that can find and replace cfg attrs automatically but comments are near invisible to that.
There was a problem hiding this comment.
That is indeed not correct, the comment is from before the post-bump rebase. Removed.
|
@bors r=Mark-Simulacrum |
|
☔ The latest upstream changes (presumably #138087) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Rebased. @bors r=Mark-Simulacrum |
|
@bors r- retry #141228 (comment) |
Use the existing Lemire (decimal -> float) and Dragon / Grisu algorithms (float -> decimal) to add support for `f16`. This allows updating the implementation for `Display` to the expected behavior for `Display` (currently it prints the a hex bitwise representation), matching other floats, and adds a `FromStr` implementation. In order to avoid crashes when compiling with Cranelift or on targets where f16 is not well supported, a fallback is used if `cfg(target_has_reliable_f16)` is not true.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
This comment was marked as outdated.
Extend the existing tests for `f32` and `f64` with versions that include `f16`'s new printing and parsing implementations. Co-authored-by: Speedy_Lex <alex.ciocildau@gmail.com>
This requires a fix to the subnormal test to cap the maximum allowed value within the maximum mantissa.
|
@bors try |
This comment was marked as outdated.
This comment was marked as outdated.
|
☀️ Try build successful - checks-actions |
|
Needed a config for Miri. @bors r=Mark-Simulacrum rollup=iffy |
|
☀️ Test successful - checks-actions |
What is this?This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.Comparing 4455c89 (parent) -> 4d051fb (this PR) Test differencesShow 17 test diffsStage 0
Stage 1
Additionally, 4 doctest diffs were found. These are ignored, as they are noisy. Job group index
Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 4d051fb306e661654d088892e02e69b8c0c39d43 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
🎉🎉🎉 just a month short of this PR’s one year anniversary, I’m very glad to have this in! Thanks @speedy-lex for all the help. |
|
Finished benchmarking commit (4d051fb): comparison URL. Overall result: ❌ regressions - no action needed@rustbot label: -perf-regression Instruction countThis is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.
Max RSS (memory usage)Results (secondary 0.2%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
CyclesResults (secondary 1.3%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Binary sizeResults (primary 0.2%, secondary 0.3%)This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.
Bootstrap: 775.321s -> 775.275s (-0.01%) |
Use the same algorithms as for
f32andf64to implementf16parsing and printing.try-job: x86_64-gnu-aux