Skip to content

Commit d3c93a3

Browse files
committed
Auto merge of #142442 - matthiaskrgr:rollup-6yodjfx, r=matthiaskrgr
Rollup of 10 pull requests Successful merges: - rust-lang/rust#134847 (Implement asymmetrical precedence for closures and jumps) - rust-lang/rust#141491 (Delegate `<CStr as Debug>` to `ByteStr`) - rust-lang/rust#141770 (Merge `Cfg::render_long_html` and `Cfg::render_long_plain` methods common code) - rust-lang/rust#142069 (Introduce `-Zmacro-stats`) - rust-lang/rust#142158 (Tracking the old name of renamed unstable library features) - rust-lang/rust#142221 ([AIX] strip underlying xcoff object) - rust-lang/rust#142340 (miri: we can use apfloat's mul_add now) - rust-lang/rust#142379 (Add bootstrap option to compile a tool with features) - rust-lang/rust#142410 (intrinsics: rename min_align_of to align_of) - rust-lang/rust#142413 (rustc-dev-guide subtree update) r? `@ghost` `@rustbot` modify labels: rollup
2 parents ce8cc6c + af92e19 commit d3c93a3

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

src/intrinsics/mod.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
272272
let a = this.read_scalar(a)?.to_f32()?;
273273
let b = this.read_scalar(b)?.to_f32()?;
274274
let c = this.read_scalar(c)?.to_f32()?;
275-
// FIXME: Using host floats, to work around https://github.com/rust-lang/rustc_apfloat/issues/11
276-
let res = a.to_host().mul_add(b.to_host(), c.to_host()).to_soft();
275+
let res = a.mul_add(b, c).value;
277276
let res = this.adjust_nan(res, &[a, b, c]);
278277
this.write_scalar(res, dest)?;
279278
}
@@ -282,8 +281,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
282281
let a = this.read_scalar(a)?.to_f64()?;
283282
let b = this.read_scalar(b)?.to_f64()?;
284283
let c = this.read_scalar(c)?.to_f64()?;
285-
// FIXME: Using host floats, to work around https://github.com/rust-lang/rustc_apfloat/issues/11
286-
let res = a.to_host().mul_add(b.to_host(), c.to_host()).to_soft();
284+
let res = a.mul_add(b, c).value;
287285
let res = this.adjust_nan(res, &[a, b, c]);
288286
this.write_scalar(res, dest)?;
289287
}
@@ -295,8 +293,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
295293
let c = this.read_scalar(c)?.to_f32()?;
296294
let fuse: bool = this.machine.float_nondet && this.machine.rng.get_mut().random();
297295
let res = if fuse {
298-
// FIXME: Using host floats, to work around https://github.com/rust-lang/rustc_apfloat/issues/11
299-
a.to_host().mul_add(b.to_host(), c.to_host()).to_soft()
296+
a.mul_add(b, c).value
300297
} else {
301298
((a * b).value + c).value
302299
};
@@ -310,8 +307,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
310307
let c = this.read_scalar(c)?.to_f64()?;
311308
let fuse: bool = this.machine.float_nondet && this.machine.rng.get_mut().random();
312309
let res = if fuse {
313-
// FIXME: Using host floats, to work around https://github.com/rust-lang/rustc_apfloat/issues/11
314-
a.to_host().mul_add(b.to_host(), c.to_host()).to_soft()
310+
a.mul_add(b, c).value
315311
} else {
316312
((a * b).value + c).value
317313
};

src/intrinsics/simd.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
321321
let b = b.to_f32()?;
322322
let c = c.to_f32()?;
323323
let res = if fuse {
324-
a.to_host().mul_add(b.to_host(), c.to_host()).to_soft()
324+
a.mul_add(b, c).value
325325
} else {
326326
((a * b).value + c).value
327327
};
@@ -333,7 +333,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
333333
let b = b.to_f64()?;
334334
let c = c.to_f64()?;
335335
let res = if fuse {
336-
a.to_host().mul_add(b.to_host(), c.to_host()).to_soft()
336+
a.mul_add(b, c).value
337337
} else {
338338
((a * b).value + c).value
339339
};

0 commit comments

Comments
 (0)