@@ -341,6 +341,8 @@ fn codegen_float_intrinsic_call<'tcx>(
341341 sym:: roundf64 => ( "round" , 1 , fx. tcx . types . f64 , types:: F64 ) ,
342342 sym:: roundevenf32 => ( "roundevenf" , 1 , fx. tcx . types . f32 , types:: F32 ) ,
343343 sym:: roundevenf64 => ( "roundeven" , 1 , fx. tcx . types . f64 , types:: F64 ) ,
344+ sym:: nearbyintf32 => ( "nearbyintf" , 1 , fx. tcx . types . f32 , types:: F32 ) ,
345+ sym:: nearbyintf64 => ( "nearbyint" , 1 , fx. tcx . types . f64 , types:: F64 ) ,
344346 sym:: sinf32 => ( "sinf" , 1 , fx. tcx . types . f32 , types:: F32 ) ,
345347 sym:: sinf64 => ( "sin" , 1 , fx. tcx . types . f64 , types:: F64 ) ,
346348 sym:: cosf32 => ( "cosf" , 1 , fx. tcx . types . f32 , types:: F32 ) ,
@@ -392,13 +394,16 @@ fn codegen_float_intrinsic_call<'tcx>(
392394 | sym:: ceilf64
393395 | sym:: truncf32
394396 | sym:: truncf64
397+ | sym:: nearbyintf32
398+ | sym:: nearbyintf64
395399 | sym:: sqrtf32
396400 | sym:: sqrtf64 => {
397401 let val = match intrinsic {
398402 sym:: fabsf32 | sym:: fabsf64 => fx. bcx . ins ( ) . fabs ( args[ 0 ] ) ,
399403 sym:: floorf32 | sym:: floorf64 => fx. bcx . ins ( ) . floor ( args[ 0 ] ) ,
400404 sym:: ceilf32 | sym:: ceilf64 => fx. bcx . ins ( ) . ceil ( args[ 0 ] ) ,
401405 sym:: truncf32 | sym:: truncf64 => fx. bcx . ins ( ) . trunc ( args[ 0 ] ) ,
406+ sym:: nearbyintf32 | sym:: nearbyintf64 => fx. bcx . ins ( ) . nearest ( args[ 0 ] ) ,
402407 sym:: sqrtf32 | sym:: sqrtf64 => fx. bcx . ins ( ) . sqrt ( args[ 0 ] ) ,
403408 _ => unreachable ! ( ) ,
404409 } ;
0 commit comments