@@ -76,6 +76,11 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
76
76
}
77
77
78
78
fn generate_nan < F1 : Float + FloatConvert < F2 > , F2 : Float > ( & self , inputs : & [ F1 ] ) -> F2 {
79
+ let this = self . eval_context_ref ( ) ;
80
+ if !this. machine . float_nondet {
81
+ return F2 :: NAN ;
82
+ }
83
+
79
84
/// Make the given NaN a signaling NaN.
80
85
/// Returns `None` if this would not result in a NaN.
81
86
fn make_signaling < F : Float > ( f : F ) -> Option < F > {
@@ -89,7 +94,6 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
89
94
if f. is_nan ( ) { Some ( f) } else { None }
90
95
}
91
96
92
- let this = self . eval_context_ref ( ) ;
93
97
let mut rand = this. machine . rng . borrow_mut ( ) ;
94
98
// Assemble an iterator of possible NaNs: preferred, quieting propagation, unchanged propagation.
95
99
// On some targets there are more possibilities; for now we just generate those options that
@@ -118,6 +122,9 @@ pub trait EvalContextExt<'tcx>: crate::MiriInterpCxExt<'tcx> {
118
122
119
123
fn equal_float_min_max < F : Float > ( & self , a : F , b : F ) -> F {
120
124
let this = self . eval_context_ref ( ) ;
125
+ if !this. machine . float_nondet {
126
+ return a;
127
+ }
121
128
// Return one side non-deterministically.
122
129
let mut rand = this. machine . rng . borrow_mut ( ) ;
123
130
if rand. random ( ) { a } else { b }
0 commit comments