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
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.
Add `f16` formatting and parsing Use the same algorithms as for `f32` and `f64` to implement `f16` parsing and printing. try-job: x86_64-gnu-aux
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.
1c38c28 to
250869e
Compare
|
@bors try |
Add `f16` formatting and parsing Use the same algorithms as for `f32` and `f64` to implement `f16` parsing and printing. try-job: x86_64-gnu-aux
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 |
…Simulacrum Add `f16` formatting and parsing Use the same algorithms as for `f32` and `f64` to implement `f16` parsing and printing. try-job: x86_64-gnu-aux
Rollup of 6 pull requests Successful merges: - rust-lang#127013 (Add `f16` formatting and parsing) - rust-lang#130887 (Safer implementation of RepeatN) - rust-lang#140154 (Cygwin support in rustc) - rust-lang#140874 (make `rustc_attr_parsing` less dominant in the rustc crate graph) - rust-lang#141094 (add regression test for rust-lang#101650) - rust-lang#141110 ([std] fix the presentation of `split_off_mut` and `split_off` documentation) r? `@ghost` `@rustbot` modify labels: rollup
|
☀️ 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%) |
…mulacrum Add `f16` formatting and parsing Use the same algorithms as for `f32` and `f64` to implement `f16` parsing and printing. try-job: x86_64-gnu-aux
Upstream Rust currently does not support printing f16s in decimal. For the intrinsics tests to work, make C++ print float16_t in the same format. Can be droppen once #127013 is merged.
Upstream Rust currently does not support printing f16s in decimal. For the intrinsics tests to work, make C++ print float16_t in the same format. Can be droppen once rust-lang#127013 is merged.
Use the same algorithms as for
f32andf64to implementf16parsing and printing.try-job: x86_64-gnu-aux