Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove f32 & f64 from MemDecoder/MemEncoder #109984

Merged
merged 1 commit into from
Apr 6, 2023
Merged

Conversation

scottmcm
Copy link
Member

@scottmcm scottmcm commented Apr 5, 2023

r? @Nilstrieb
since they said (maybe joked) on discord that it's a bug if the compiler uses f32 anywhere 🙃

@rustbot rustbot added A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 5, 2023
@scottmcm scottmcm force-pushed the less-float branch 2 times, most recently from a92833c to a9a680d Compare April 5, 2023 21:58
@Nilstrieb
Copy link
Member

can you add a reference to this PR so that people can revert it if they need it later (which they probably don't but you never know)?

Copy link
Member

@Nilstrieb Nilstrieb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

r=me

@scottmcm
Copy link
Member Author

scottmcm commented Apr 6, 2023

Sure thing; done.

If you're here in the future: you might want to change how this works, because using LEB128 for floats is a poor choice -- even a simple float like 1.0_f32 takes 5 bytes since all the zeros are in the low bits. It should probably either be always 4 bytes or do a swap_bytes before the LEB128 encoding.

Indeed, the only f32s for which ordinary LEB128 encoding is better than "always 4 bytes" are 0 through 2.938734e-39. And I suspect those (other than zero itself) are not particularly common -- after all, they're subnormal.

@scottmcm
Copy link
Member Author

scottmcm commented Apr 6, 2023

@bors r=Nilstrieb

@bors
Copy link
Contributor

bors commented Apr 6, 2023

📌 Commit 5cb23e4 has been approved by Nilstrieb

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 6, 2023
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this pull request Apr 6, 2023
Remove f32 & f64 from MemDecoder/MemEncoder

r? `@Nilstrieb`
since they said (maybe joked) on discord that it's a bug if the compiler uses f32 anywhere 🙃
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Apr 6, 2023
Remove f32 & f64 from MemDecoder/MemEncoder

r? ``@Nilstrieb``
since they said (maybe joked) on discord that it's a bug if the compiler uses f32 anywhere 🙃
bors added a commit to rust-lang-ci/rust that referenced this pull request Apr 6, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#109395 (Fix issue when there are multiple candidates for edit_distance_with_substrings)
 - rust-lang#109755 (Implement support for `GeneratorWitnessMIR` in new solver)
 - rust-lang#109782 (Don't leave a comma at the start of argument list when removing arguments)
 - rust-lang#109977 (rustdoc: avoid including line numbers in Google SERP snippets)
 - rust-lang#109980 (Derive String's PartialEq implementation)
 - rust-lang#109984 (Remove f32 & f64 from MemDecoder/MemEncoder)
 - rust-lang#110004 (add `dont_check_failure_status` option in the compiler test)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 4ecfb7f into rust-lang:master Apr 6, 2023
@rustbot rustbot added this to the 1.70.0 milestone Apr 6, 2023
@scottmcm scottmcm deleted the less-float branch April 7, 2023 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-query-system Area: The rustc query system (https://rustc-dev-guide.rust-lang.org/query.html) S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants