|
1 |
| -use rand::Rng; |
2 | 1 | use rustc_apfloat::{self, Float, FloatConvert, Round};
|
3 | 2 | use rustc_middle::mir;
|
4 | 3 | use rustc_middle::ty::{self, FloatTy};
|
@@ -39,46 +38,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
|
39 | 38 | "sqrtf64" => sqrt::<rustc_apfloat::ieee::Double>(this, args, dest)?,
|
40 | 39 | "sqrtf128" => sqrt::<rustc_apfloat::ieee::Quad>(this, args, dest)?,
|
41 | 40 |
|
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 |
| - |
82 | 41 | #[rustfmt::skip]
|
83 | 42 | | "fadd_fast"
|
84 | 43 | | "fsub_fast"
|
|
0 commit comments