@@ -225,7 +225,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
225225 }
226226
227227 "sinf32" | "fabsf32" | "cosf32" | "sqrtf32" | "expf32" | "exp2f32" | "logf32" |
228- "log10f32" | "log2f32" | "floorf32" | "ceilf32" | "truncf32" => {
228+ "log10f32" | "log2f32" | "floorf32" | "ceilf32" | "truncf32" | "roundf32" => {
229229 // FIXME: Using host floats.
230230 let f = f32:: from_bits ( this. read_scalar ( args[ 0 ] ) ?. to_u32 ( ) ?) ;
231231 let f = match intrinsic_name. get ( ) {
@@ -241,13 +241,14 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
241241 "floorf32" => f. floor ( ) ,
242242 "ceilf32" => f. ceil ( ) ,
243243 "truncf32" => f. trunc ( ) ,
244+ "roundf32" => f. round ( ) ,
244245 _ => bug ! ( ) ,
245246 } ;
246247 this. write_scalar ( Scalar :: from_u32 ( f. to_bits ( ) ) , dest) ?;
247248 }
248249
249250 "sinf64" | "fabsf64" | "cosf64" | "sqrtf64" | "expf64" | "exp2f64" | "logf64" |
250- "log10f64" | "log2f64" | "floorf64" | "ceilf64" | "truncf64" => {
251+ "log10f64" | "log2f64" | "floorf64" | "ceilf64" | "truncf64" | "roundf64" => {
251252 // FIXME: Using host floats.
252253 let f = f64:: from_bits ( this. read_scalar ( args[ 0 ] ) ?. to_u64 ( ) ?) ;
253254 let f = match intrinsic_name. get ( ) {
@@ -263,6 +264,7 @@ pub trait EvalContextExt<'mir, 'tcx: 'mir>: crate::MiriEvalContextExt<'mir, 'tcx
263264 "floorf64" => f. floor ( ) ,
264265 "ceilf64" => f. ceil ( ) ,
265266 "truncf64" => f. trunc ( ) ,
267+ "roundf64" => f. round ( ) ,
266268 _ => bug ! ( ) ,
267269 } ;
268270 this. write_scalar ( Scalar :: from_u64 ( f. to_bits ( ) ) , dest) ?;
0 commit comments