diff options
| author | bors <bors@rust-lang.org> | 2025-06-29 13:02:15 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2025-06-29 13:02:15 +0000 |
| commit | 5e749eb66f93ee998145399fbdde337e57cd72ef (patch) | |
| tree | d65258dfb97ff2deeeb4a313b107ec2eef0e20dd /src/tools | |
| parent | 5ca574e85b67cec0a6fc3fddfe398cbe676c9c69 (diff) | |
| parent | f9f3935fa7052430e64496d7501b8fc46e861aac (diff) | |
Auto merge of #143183 - GuillaumeGomez:rollup-g60lr91, r=GuillaumeGomez
Rollup of 4 pull requests Successful merges: - rust-lang/rust#142078 (Add SIMD funnel shift and round-to-even intrinsics) - rust-lang/rust#142214 (`tests/ui`: A New Order [9/N]) - rust-lang/rust#142417 (`tests/ui`: A New Order [12/N]) - rust-lang/rust#143030 (Fix suggestion spans inside macros for the `unused_must_use` lint) r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/miri/src/intrinsics/simd.rs | 2 | ||||
| -rw-r--r-- | src/tools/miri/tests/pass/intrinsics/portable-simd.rs | 8 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/tools/miri/src/intrinsics/simd.rs b/src/tools/miri/src/intrinsics/simd.rs index 52224f33c73..e63992aa95f 100644 --- a/src/tools/miri/src/intrinsics/simd.rs +++ b/src/tools/miri/src/intrinsics/simd.rs @@ -36,6 +36,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { | "ceil" | "floor" | "round" + | "round_ties_even" | "trunc" | "fsqrt" | "fsin" @@ -71,6 +72,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> { "ceil" => Op::Round(rustc_apfloat::Round::TowardPositive), "floor" => Op::Round(rustc_apfloat::Round::TowardNegative), "round" => Op::Round(rustc_apfloat::Round::NearestTiesToAway), + "round_ties_even" => Op::Round(rustc_apfloat::Round::NearestTiesToEven), "trunc" => Op::Round(rustc_apfloat::Round::TowardZero), "ctlz" => Op::Numeric(sym::ctlz), "ctpop" => Op::Numeric(sym::ctpop), diff --git a/src/tools/miri/tests/pass/intrinsics/portable-simd.rs b/src/tools/miri/tests/pass/intrinsics/portable-simd.rs index e14ce51f35a..726d4c01cc3 100644 --- a/src/tools/miri/tests/pass/intrinsics/portable-simd.rs +++ b/src/tools/miri/tests/pass/intrinsics/portable-simd.rs @@ -570,6 +570,10 @@ fn simd_round() { f32x4::from_array([1.0, 1.0, 2.0, -5.0]) ); assert_eq!( + unsafe { intrinsics::simd_round_ties_even(f32x4::from_array([0.9, 1.001, 2.0, -4.5])) }, + f32x4::from_array([1.0, 1.0, 2.0, -4.0]) + ); + assert_eq!( f32x4::from_array([0.9, 1.001, 2.0, -4.5]).trunc(), f32x4::from_array([0.0, 1.0, 2.0, -4.0]) ); @@ -587,6 +591,10 @@ fn simd_round() { f64x4::from_array([1.0, 1.0, 2.0, -5.0]) ); assert_eq!( + unsafe { intrinsics::simd_round_ties_even(f64x4::from_array([0.9, 1.001, 2.0, -4.5])) }, + f64x4::from_array([1.0, 1.0, 2.0, -4.0]) + ); + assert_eq!( f64x4::from_array([0.9, 1.001, 2.0, -4.5]).trunc(), f64x4::from_array([0.0, 1.0, 2.0, -4.0]) ); |
