10000 Auto merge of #147019 - Zalathar:rollup-boxzbmo, r=Zalathar · rust-lang/miri@1e67c4a · GitHub
[go: up one dir, main page]

Skip to content

Commit 1e67c4a

Browse files
committed
Auto merge of #147019 - Zalathar:rollup-boxzbmo, r=Zalathar
Rollup of 14 pull requests Successful merges: - rust-lang/rust#145067 (RawVecInner: add missing `unsafe` to unsafe fns) - rust-lang/rust#145277 (Do not materialise X in [X; 0] when X is unsizing a const) - rust-lang/rust#145973 (Add `std` support for `armv7a-vex-v5`) - rust-lang/rust#146667 (Add an attribute to check the number of lanes in a SIMD vector after monomorphization) - rust-lang/rust#146735 (unstably constify float mul_add methods) - rust-lang/rust#146737 (f16_f128: enable some more tests in Miri) - rust-lang/rust#146766 (Add attributes for #[global_allocator] functions) - rust-lang/rust#146905 (llvm: update remarks support on LLVM 22) - rust-lang/rust#146982 (Remove erroneous normalization step in `tests/run-make/linker-warning`) - rust-lang/rust#147005 (Small string formatting cleanup) - rust-lang/rust#147007 (Explicitly note `&[SocketAddr]` impl of `ToSocketAddrs`) - rust-lang/rust#147008 (bootstrap.py: Respect build.jobs while building bootstrap tool) - rust-lang/rust#147013 (rustdoc: Fix documentation for `--doctest-build-arg`) - rust-lang/rust#147015 (Use `LLVMDisposeTargetMachine`) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 39d3b7c + b03d78a commit 1e67c4a

File tree

2 files changed

+5
-41
lines changed

2 files changed

+5
-41
lines changed

src/intrinsics/math.rs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
use rand::Rng;
21
use rustc_apfloat::{self, Float, FloatConvert, Round};
32
use rustc_middle::mir;
43
use rustc_middle::ty::{self, FloatTy};
@@ -39,46 +38,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
3938
"sqrtf64" => sqrt::<rustc_apfloat::ieee::Double>(this, args, dest)?,
4039
"sqrtf128" => sqrt::<rustc_apfloat::ieee::Quad>(this, args, dest)?,
4140

42-
"fmaf32" => {
43-
let [a, b, c] = check_intrinsic_arg_count(args)?;
44-
let a = this.read_scalar(a)?.to_f32()?;
45-
let b = this.re F440 ad_scalar(b)?.to_f32()?;
46-
let c = this.read_scalar(c)?.to_f32()?;
47-
let res = a.mul_add(b, c).value;
48-
let res = this.adjust_nan(res, &[a, b, c]);
49-
this.write_scalar(res, dest)?;
50-
}
51-
"fmaf64" => {
52-
let [a, b, c] = check_intrinsic_arg_count(args)?;
53-
let a = this.read_scalar(a)?.to_f64()?;
54-
let b = this.read_scalar(b)?.to_f64()?;
55-
let c = this.read_scalar(c)?.to_f64()?;
56-
let res = a.mul_add(b, c).value;
57-
let res = this.adjust_nan(res, &[a, b, c]);
58-
this.write_scalar(res, dest)?;
59-
}
60-
61-
"fmuladdf32" => {
62-
let [a, b, c] = check_intrinsic_arg_count(args)?;
63-
let a = this.read_scalar(a)?.to_f32()?;
64-
let b = this.read_scalar(b)?.to_f32()?;
65-
let c = this.read_scalar(c)?.to_f32()?;
66-
let fuse: bool = this.machine.float_nondet && this.machine.rng.get_mut().random();
67-
let res = if fuse { a.mul_add(b, c).value } else { ((a * b).value + c).value };
68-
let res = this.adjust_nan(res, &[a, b, c]);
69-
this.write_scalar(res, dest)?;
70-
}
71-
"fmuladdf64" => {
72-
let [a, b, c] = check_intrinsic_arg_count(args)?;
73-
let a = this.read_scalar(a)?.to_f64()?;
74-
let b = this.read_scalar(b)?.to_f64()?;
75-
let c = this.read_scalar(c)?.to_f64()?;
76-
let fuse: bool = this.machine.float_nondet && this.machine.rng.get_mut().random();
77-
let res = if fuse { a.mul_add(b, c).value } else { ((a * b).value + c).value };
78-
let res = this.adjust_nan(res, &[a, b, c]);
79-
this.write_scalar(res, dest)?;
80-
}
81-
8241
#[rustfmt::skip]
8342
| "fadd_fast"
8443
| "fsub_fast"

src/machine.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,11 @@ impl<'tcx> Machine<'tcx> for MiriMachine<'tcx> {
12931293
ecx.equal_float_min_max(a, b)
12941294
}
12951295

1296+
#[inline(always)]
1297+
fn float_fuse_mul_add(ecx: &mut InterpCx<'tcx, Self>) -> bool {
1298+
ecx.machine.float_nondet && ecx.machine.rng.get_mut().random()
1299+
}
1300+
12961301
#[inline(always)]
12971302
fn ub_checks(ecx: &InterpCx<'tcx, Self>) -> InterpResult<'tcx, bool> {
12981303
interp_ok(ecx.tcx.sess.ub_checks())

0 commit comments

Comments
 (0)
0