@@ -272,8 +272,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
272
272
let a = this. read_scalar ( a) ?. to_f32 ( ) ?;
273
273
let b = this. read_scalar ( b) ?. to_f32 ( ) ?;
274
274
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 ;
277
276
let res = this. adjust_nan ( res, & [ a, b, c] ) ;
278
277
this. write_scalar ( res, dest) ?;
279
278
}
@@ -282,8 +281,7 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
282
281
let a = this. read_scalar ( a) ?. to_f64 ( ) ?;
283
282
let b = this. read_scalar ( b) ?. to_f64 ( ) ?;
284
283
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 ;
287
285
let res = this. adjust_nan ( res, & [ a, b, c] ) ;
288
286
this. write_scalar ( res, dest) ?;
289
287
}
@@ -293,13 +291,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
293
291
let a = this. read_scalar ( a) ?. to_f32 ( ) ?;
294
292
let b = this. read_scalar ( b) ?. to_f32 ( ) ?;
295
293
let c = this. read_scalar ( c) ?. to_f32 ( ) ?;
296
- let fuse: bool = this. machine . rng . get_mut ( ) . random ( ) ;
297
- 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 ( )
300
- } else {
301
- ( ( a * b) . value + c) . value
302
- } ;
294
+ let fuse: bool = this. machine . float_nondet && this. machine . rng . get_mut ( ) . random ( ) ;
295
+ let res = if fuse { a. mul_add ( b, c) . value } else { ( ( a * b) . value + c) . value } ;
303
296
let res = this. adjust_nan ( res, & [ a, b, c] ) ;
304
297
this. write_scalar ( res, dest) ?;
305
298
}
@@ -308,13 +301,8 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
308
301
let a = this. read_scalar ( a) ?. to_f64 ( ) ?;
309
302
let b = this. read_scalar ( b) ?. to_f64 ( ) ?;
310
303
let c = this. read_scalar ( c) ?. to_f64 ( ) ?;
311
- let fuse: bool = this. machine . rng . get_mut ( ) . random ( ) ;
312
- 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 ( )
315
- } else {
316
- ( ( a * b) . value + c) . value
317
- } ;
304
+ let fuse: bool = this. machine . float_nondet && this. machine . rng . get_mut ( ) . random ( ) ;
305
+ let res = if fuse { a. mul_add ( b, c) . value } else { ( ( a * b) . value + c) . value } ;
318
306
let res = this. adjust_nan ( res, & [ a, b, c] ) ;
319
307
this. write_scalar ( res, dest) ?;
320
308
}
0 commit comments