Better float casting tests in coretests#152597
Better float casting tests in coretests#152597eggyal wants to merge 2 commits intorust-lang:mainfrom
coretests#152597Conversation
|
|
This comment has been minimized.
This comment has been minimized.
|
My first exposure to the cranelift codebase was in the float constant PR, so I'm by no means an expert. There was a change in that PR that you might want to cherry pick so it solves the separate f128->int casts issue c4582c8 For this CI failure, in the lib_call on line 220, should that rust/compiler/rustc_codegen_cranelift/src/codegen_f16_f128.rs Lines 207 to 254 in a423f68 |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
|
That linking error should be what the commit (c4582c8) fixes. The symbols starts with It should merge sometime later today, probably easiest to just rebase once it does. |
|
Ah, indeed - I messed up the cherry-pick, apologies. |
Per rust-lang#152597 (comment) Co-authored-by: okaneco <47607823+okaneco@users.noreply.github.com>
|
Some changes occurred in compiler/rustc_codegen_cranelift cc @bjorn3 |
6771c64 to
0e1b15d
Compare
|
The Miri subtree was changed cc @rust-lang/miri |
|
Miri does run coretests but not in its own CI, so I don't think we should remove existing tests. |
fafad4d to
0e1b15d
Compare
| #[test] | ||
| fn nan_casts() { | ||
| let nan1 = f64::from_bits(0x7FF0_0001_0000_0001u64); | ||
| let nan2 = f64::from_bits(0x7FF0_0000_0000_0001u64); | ||
|
|
||
| assert!(nan1.is_nan()); | ||
| assert!(nan2.is_nan()); | ||
|
|
||
| let nan1_32 = nan1 as f32; | ||
| let nan2_32 = nan2 as f32; | ||
|
|
||
| assert!(nan1_32.is_nan()); | ||
| assert!(nan2_32.is_nan()); | ||
| } |
There was a problem hiding this comment.
Could you cover f16 and f128 here as well?
There was a problem hiding this comment.
All starting from f64, or do we want to test NaN casts going in other directions too?
|
Reminder, once the PR becomes ready for a review, use |
0e1b15d to
ee9e05d
Compare
This comment has been minimized.
This comment has been minimized.
ee9e05d to
5c66c74
Compare
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
A direct port of the float casting tests from MIRI.
5c66c74 to
9528514
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
A direct port of the float casting tests from MIRI.
Closes #152592
r? tgross35