@@ -225,7 +225,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
225
225
}
226
226
227
227
"sinf32" | "fabsf32" | "cosf32" | "sqrtf32" | "expf32" | "exp2f32" | "logf32" |
228
- "log10f32" | "log2f32" | "floorf32" | "ceilf32" | "truncf32" => {
228
+ "log10f32" | "log2f32" | "floorf32" | "ceilf32" | "truncf32" | "roundf32" => {
229
229
// FIXME: Using host floats.
230
230
let f = f32:: from_bits ( this. read_scalar ( args[ 0 ] ) ?. to_u32 ( ) ?) ;
231
231
let f = match intrinsic_name. get ( ) {
@@ -241,13 +241,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
241
241
"floorf32" => f. floor ( ) ,
242
242
"ceilf32" => f. ceil ( ) ,
243
243
"truncf32" => f. trunc ( ) ,
244
+ "roundf32" => f. round ( ) ,
244
245
_ => bug ! ( ) ,
245
246
} ;
246
247
this. write_scalar ( Scalar :: from_u32 ( f. to_bits ( ) ) , dest) ?;
247
248
}
248
249
249
250
"sinf64" | "fabsf64" | "cosf64" | "sqrtf64" | "expf64" | "exp2f64" | "logf64" |
250
- "log10f64" | "log2f64" | "floorf64" | "ceilf64" | "truncf64" => {
251
+ "log10f64" | "log2f64" | "floorf64" | "ceilf64" | "truncf64" | "roundf64" => {
251
252
// FIXME: Using host floats.
252
253
let f = f64:: from_bits ( this. read_scalar ( args[ 0 ] ) ?. to_u64 ( ) ?) ;
253
254
let f = match intrinsic_name. get ( ) {
@@ -263,6 +264,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
263
264
"floorf64" => f. floor ( ) ,
264
265
"ceilf64" => f. ceil ( ) ,
265
266
"truncf64" => f. trunc ( ) ,
267
+ "roundf64" => f. round ( ) ,
266
268
_ => bug ! ( ) ,
267
269
} ;
268
270
this. write_scalar ( Scalar :: from_u64 ( f. to_bits ( ) ) , dest) ?;
0 commit comments