@@ -1142,6 +1142,19 @@ extern "rust-intrinsic" {
1142
1142
/// Returns the absolute value of an `f64`.
1143
1143
pub fn fabsf64 ( x : f64 ) -> f64 ;
1144
1144
1145
+ /// Returns the minimum of two `f32` values.
1146
+ #[ cfg( not( stage0) ) ]
1147
+ pub fn minnumf32 ( x : f32 , y : f32 ) -> f32 ;
1148
+ /// Returns the minimum of two `f64` values.
1149
+ #[ cfg( not( stage0) ) ]
1150
+ pub fn minnumf64 ( x : f64 , y : f64 ) -> f64 ;
1151
+ /// Returns the maximum of two `f32` values.
1152
+ #[ cfg( not( stage0) ) ]
1153
+ pub fn maxnumf32 ( x : f32 , y : f32 ) -> f32 ;
1154
+ /// Returns the maximum of two `f64` values.
1155
+ #[ cfg( not( stage0) ) ]
1156
+ pub fn maxnumf64 ( x : f64 , y : f64 ) -> f64 ;
1157
+
1145
1158
/// Copies the sign from `y` to `x` for `f32` values.
1146
1159
pub fn copysignf32 ( x : f32 , y : f32 ) -> f32 ;
1147
1160
/// Copies the sign from `y` to `x` for `f64` values.
@@ -1393,3 +1406,25 @@ extern "rust-intrinsic" {
1393
1406
#[ cfg( not( stage0) ) ]
1394
1407
pub fn nontemporal_store < T > ( ptr : * mut T , val : T ) ;
1395
1408
}
1409
+
1410
+ // Simple bootstrap implementations for stage0 compilation
1411
+ /// Returns the minimum of two `f32` values.
1412
+ #[ cfg( stage0) ]
1413
+ pub unsafe fn minnumf32 ( x : f32 , y : f32 ) -> f32 {
1414
+ ( if x < y || y != y { x } else { y } ) * 1.0
1415
+ }
1416
+ /// Returns the minimum of two `f64` values.
1417
+ #[ cfg( stage0) ]
1418
+ pub unsafe fn minnumf64 ( x : f64 , y : f64 ) -> f64 {
1419
+ ( if x < y || y != y { x } else { y } ) * 1.0
1420
+ }
1421
+ /// Returns the maximum of two `f32` values.
1422
+ #[ cfg( stage0) ]
1423
+ pub unsafe fn maxnumf32 ( x : f32 , y : f32 ) -> f32 {
1424
+ ( if x < y || x != x { y } else { x } ) * 1.0
1425
+ }
1426
+ /// Returns the maximum of two `f64` values.
1427
+ #[ cfg( stage0) ]
1428
+ pub unsafe fn maxnumf64 ( x : f64 , y : f64 ) -> f64 {
1429
+ ( if x < y || x != x { y } else { x } ) * 1.0
1430
+ }
0 commit comments