@@ -341,6 +341,8 @@ fn codegen_float_intrinsic_call<'tcx>(
341
341
sym:: roundf64 => ( "round" , 1 , fx. tcx . types . f64 , types:: F64 ) ,
342
342
sym:: roundevenf32 => ( "roundevenf" , 1 , fx. tcx . types . f32 , types:: F32 ) ,
343
343
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 ) ,
344
346
sym:: sinf32 => ( "sinf" , 1 , fx. tcx . types . f32 , types:: F32 ) ,
345
347
sym:: sinf64 => ( "sin" , 1 , fx. tcx . types . f64 , types:: F64 ) ,
346
348
sym:: cosf32 => ( "cosf" , 1 , fx. tcx . types . f32 , types:: F32 ) ,
@@ -392,13 +394,16 @@ fn codegen_float_intrinsic_call<'tcx>(
392
394
| sym:: ceilf64
393
395
| sym:: truncf32
394
396
| sym:: truncf64
397
+ | sym:: nearbyintf32
398
+ | sym:: nearbyintf64
395
399
| sym:: sqrtf32
396
400
| sym:: sqrtf64 => {
397
401
let val = match intrinsic {
398
402
sym:: fabsf32 | sym:: fabsf64 => fx. bcx . ins ( ) . fabs ( args[ 0 ] ) ,
399
403
sym:: floorf32 | sym:: floorf64 => fx. bcx . ins ( ) . floor ( args[ 0 ] ) ,
400
404
sym:: ceilf32 | sym:: ceilf64 => fx. bcx . ins ( ) . ceil ( args[ 0 ] ) ,
401
405
sym:: truncf32 | sym:: truncf64 => fx. bcx . ins ( ) . trunc ( args[ 0 ] ) ,
406
+ sym:: nearbyintf32 | sym:: nearbyintf64 => fx. bcx . ins ( ) . nearest ( args[ 0 ] ) ,
402
407
sym:: sqrtf32 | sym:: sqrtf64 => fx. bcx . ins ( ) . sqrt ( args[ 0 ] ) ,
403
408
_ => unreachable ! ( ) ,
404
409
} ;
0 commit comments