Skip to content

Rollup of 6 pull requests #124140

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

Closed
wants to merge 18 commits into from
Closed
Changes from 2 commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
f09c19a
Introduce perma-unstable `wasm-c-abi` flag
daxpedda Feb 27, 2024
9e2c658
Remove `TargetOptions::default_adjusted_cabi`
daxpedda Dec 13, 2023
bbd359f
Add regression test for issue 120600
WaffleLapkin Apr 6, 2024
1737162
Add a test for `a == b` where `a: !, b: !`
WaffleLapkin Apr 6, 2024
62d956f
Correctly change type when adding adjustments on top of `NeverToAny`
WaffleLapkin Apr 6, 2024
19821ad
Properly handle emojis as literal prefix in macros
estebank Apr 10, 2024
86a5765
Add an opt-in to store incoming edges in `VecGraph` + some docs
WaffleLapkin Apr 15, 2024
7d2cb3d
Make `graph::DepthFirstSearch` accept `G` by value
WaffleLapkin Apr 15, 2024
fa134b5
Add `graph::depth_first_search_as_undirected`
WaffleLapkin Apr 15, 2024
cc12a1b
Fix negating `f16` and `f128` constants
beetrees Apr 18, 2024
3e63398
when suggesting RUST_BACKTRACE=1, add a special note for Miri's env v…
RalfJung Apr 18, 2024
523fe2b
Add tests for predecessor-aware `VecGraph` mode
WaffleLapkin Apr 18, 2024
367fb06
Rollup merge of #117919 - daxpedda:wasm-c-abi, r=wesleywiser
workingjubilee Apr 18, 2024
b7201be
Rollup merge of #123571 - WaffleLapkin:properly-adjust-never, r=compi…
workingjubilee Apr 18, 2024
b8b4999
Rollup merge of #123752 - estebank:emoji-prefix, r=wesleywiser
workingjubilee Apr 18, 2024
8141ab8
Rollup merge of #123980 - WaffleLapkin:graph-average-refactor, r=wesl…
workingjubilee Apr 18, 2024
7eba698
Rollup merge of #124110 - beetrees:neg-f16-f128, r=compiler-errors
workingjubilee Apr 18, 2024
8d5587e
Rollup merge of #124116 - RalfJung:miri-rust-backtrace, r=Nilstrieb
workingjubilee Apr 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 14 additions & 2 deletions compiler/rustc_mir_build/src/build/mod.rs
Original file line number Diff line number Diff line change
@@ -1023,7 +1023,13 @@ pub(crate) fn parse_float_into_scalar(
let num = num.as_str();
match float_ty {
// FIXME(f16_f128): When available, compare to the library parser as with `f32` and `f64`
ty::FloatTy::F16 => num.parse::<Half>().ok().map(Scalar::from_f16),
ty::FloatTy::F16 => {
let mut f = num.parse::<Half>().ok()?;
if neg {
f = -f;
}
Some(Scalar::from_f16(f))
}
ty::FloatTy::F32 => {
let Ok(rust_f) = num.parse::<f32>() else { return None };
let mut f = num
@@ -1071,7 +1077,13 @@ pub(crate) fn parse_float_into_scalar(
Some(Scalar::from_f64(f))
}
// FIXME(f16_f128): When available, compare to the library parser as with `f32` and `f64`
ty::FloatTy::F128 => num.parse::<Quad>().ok().map(Scalar::from_f128),
ty::FloatTy::F128 => {
let mut f = num.parse::<Quad>().ok()?;
if neg {
f = -f;
}
Some(Scalar::from_f128(f))
}
}
}

16 changes: 16 additions & 0 deletions tests/ui/numbers-arithmetic/f16-f128-lit.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
//@ run-pass

#![feature(f16)]
#![feature(f128)]

fn main() {
assert_eq!(0.0_f16.to_bits(), 0x0000);
assert_eq!((-0.0_f16).to_bits(), 0x8000);
assert_eq!(10.0_f16.to_bits(), 0x4900);
assert_eq!((-10.0_f16).to_bits(), 0xC900);

assert_eq!(0.0_f128.to_bits(), 0x0000_0000_0000_0000_0000_0000_0000_0000);
assert_eq!((-0.0_f128).to_bits(), 0x8000_0000_0000_0000_0000_0000_0000_0000);
assert_eq!(10.0_f128.to_bits(), 0x4002_4000_0000_0000_0000_0000_0000_0000);
assert_eq!((-10.0_f128).to_bits(), 0xC002_4000_0000_0000_0000_0000_0000_0000);
}