@@ -3907,7 +3907,7 @@ pub const unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize) {
3907
3907
}
3908
3908
}
3909
3909
3910
- /// Returns the minimum of two `f16` values.
3910
+ /// Returns the minimum (IEEE 754-2008 minNum) of two `f16` values.
3911
3911
///
3912
3912
/// Note that, unlike most intrinsics, this is safe to call;
3913
3913
/// it does not require an `unsafe` block.
@@ -3920,7 +3920,7 @@ pub const unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize) {
3920
3920
#[ rustc_intrinsic]
3921
3921
pub const fn minnumf16 ( x : f16 , y : f16 ) -> f16 ;
3922
3922
3923
- /// Returns the minimum of two `f32` values.
3923
+ /// Returns the minimum (IEEE 754-2008 minNum) of two `f32` values.
3924
3924
///
3925
3925
/// Note that, unlike most intrinsics, this is safe to call;
3926
3926
/// it does not require an `unsafe` block.
@@ -3934,7 +3934,7 @@ pub const fn minnumf16(x: f16, y: f16) -> f16;
3934
3934
#[ rustc_intrinsic]
3935
3935
pub const fn minnumf32 ( x : f32 , y : f32 ) -> f32 ;
3936
3936
3937
- /// Returns the minimum of two `f64` values.
3937
+ /// Returns the minimum (IEEE 754-2008 minNum) of two `f64` values.
3938
3938
///
3939
3939
/// Note that, unlike most intrinsics, this is safe to call;
3940
3940
/// it does not require an `unsafe` block.
@@ -3948,7 +3948,7 @@ pub const fn minnumf32(x: f32, y: f32) -> f32;
3948
3948
#[ rustc_intrinsic]
3949
3949
pub const fn minnumf64 ( x : f64 , y : f64 ) -> f64 ;
3950
3950
3951
- /// Returns the minimum of two `f128` values.
3951
+ /// Returns the minimum (IEEE 754-2008 minNum) of two `f128` values.
3952
3952
///
3953
3953
/// Note that, unlike most intrinsics, this is safe to call;
3954
3954
/// it does not require an `unsafe` block.
@@ -3961,7 +3961,91 @@ pub const fn minnumf64(x: f64, y: f64) -> f64;
3961
3961
#[ rustc_intrinsic]
3962
3962
pub const fn minnumf128 ( x : f128 , y : f128 ) -> f128 ;
3963
3963
3964
- /// Returns the maximum of two `f16` values.
3964
+ /// Returns the minimum (IEEE 754-2019 minimum) of two `f16` values.
3965
+ ///
3966
+ /// Note that, unlike most intrinsics, this is safe to call;
3967
+ /// it does not require an `unsafe` block.
3968
+ /// Therefore, implementations must not require the user to uphold
3969
+ /// any safety invariants.
3970
+ #[ rustc_nounwind]
3971
+ #[ cfg_attr( not( bootstrap) , rustc_intrinsic) ]
3972
+ pub const fn minimumf16 ( x : f16 , y : f16 ) -> f16 {
3973
+ if x < y {
3974
+ x
3975
+ } else if y < x {
3976
+ y
3977
+ } else if x == y {
3978
+ if x. is_sign_negative ( ) && y. is_sign_positive ( ) { x } else { y }
3979
+ } else {
3980
+ // At least one input is NaN. Use `+` to perform NaN propagation and quieting.
3981
+ x + y
3982
+ }
3983
+ }
3984
+
3985
+ /// Returns the minimum (IEEE 754-2019 minimum) of two `f32` values.
3986
+ ///
3987
+ /// Note that, unlike most intrinsics, this is safe to call;
3988
+ /// it does not require an `unsafe` block.
3989
+ /// Therefore, implementations must not require the user to uphold
3990
+ /// any safety invariants.
3991
+ #[ rustc_nounwind]
3992
+ #[ cfg_attr( not( bootstrap) , rustc_intrinsic) ]
3993
+ pub const fn minimumf32 ( x : f32 , y : f32 ) -> f32 {
3994
+ if x < y {
3995
+ x
3996
+ } else if y < x {
3997
+ y
3998
+ } else if x == y {
3999
+ if x. is_sign_negative ( ) && y. is_sign_positive ( ) { x } else { y }
4000
+ } else {
4001
+ // At least one input is NaN. Use `+` to perform NaN propagation and quieting.
4002
+ x + y
4003
+ }
4004
+ }
4005
+
4006
+ /// Returns the minimum (IEEE 754-2019 minimum) of two `f64` values.
4007
+ ///
4008
+ /// Note that, unlike most intrinsics, this is safe to call;
4009
+ /// it does not require an `unsafe` block.
4010
+ /// Therefore, implementations must not require the user to uphold
4011
+ /// any safety invariants.
4012
+ #[ rustc_nounwind]
4013
+ #[ cfg_attr( not( bootstrap) , rustc_intrinsic) ]
4014
+ pub const fn minimumf64 ( x : f64 , y : f64 ) -> f64 {
4015
+ if x < y {
4016
+ x
4017
+ } else if y < x {
4018
+ y
4019
+ } else if x == y {
4020
+ if x. is_sign_negative ( ) && y. is_sign_positive ( ) { x } else { y }
4021
+ } else {
4022
+ // At least one input is NaN. Use `+` to perform NaN propagation and quieting.
4023
+ x + y
4024
+ }
4025
+ }
4026
+
4027
+ /// Returns the minimum (IEEE 754-2019 minimum) of two `f128` values.
4028
+ ///
4029
+ /// Note that, unlike most intrinsics, this is safe to call;
4030
+ /// it does not require an `unsafe` block.
4031
+ /// Therefore, implementations must not require the user to uphold
4032
+ /// any safety invariants.
4033
+ #[ rustc_nounwind]
4034
+ #[ cfg_attr( not( bootstrap) , rustc_intrinsic) ]
4035
+ pub const fn minimumf128 ( x : f128 , y : f128 ) -> f128 {
4036
+ if x < y {
4037
+ x
4038
+ } else if y < x {
4039
+ y
4040
+ } else if x == y {
4041
+ if x. is_sign_negative ( ) && y. is_sign_positive ( ) { x } else { y }
4042
+ } else {
4043
+ // At least one input is NaN. Use `+` to perform NaN propagation and quieting.
4044
+ x + y
4045
+ }
4046
+ }
4047
+
4048
+ /// Returns the maximum (IEEE 754-2008 maxNum) of two `f16` values.
3965
4049
///
3966
4050
/// Note that, unlike most intrinsics, this is safe to call;
3967
4051
/// it does not require an `unsafe` block.
@@ -3974,7 +4058,7 @@ pub const fn minnumf128(x: f128, y: f128) -> f128;
3974
4058
#[ rustc_intrinsic]
3975
4059
pub const fn maxnumf16 ( x : f16 , y : f16 ) -> f16 ;
3976
4060
3977
- /// Returns the maximum of two `f32` values.
4061
+ /// Returns the maximum (IEEE 754-2008 maxNum) of two `f32` values.
3978
4062
///
3979
4063
/// Note that, unlike most intrinsics, this is safe to call;
3980
4064
/// it does not require an `unsafe` block.
@@ -3988,7 +4072,7 @@ pub const fn maxnumf16(x: f16, y: f16) -> f16;
3988
4072
#[ rustc_intrinsic]
3989
4073
pub const fn maxnumf32 ( x : f32 , y : f32 ) -> f32 ;
3990
4074
3991
- /// Returns the maximum of two `f64` values.
4075
+ /// Returns the maximum (IEEE 754-2008 maxNum) of two `f64` values.
3992
4076
///
3993
4077
/// Note that, unlike most intrinsics, this is safe to call;
3994
4078
/// it does not require an `unsafe` block.
@@ -4002,7 +4086,7 @@ pub const fn maxnumf32(x: f32, y: f32) -> f32;
4002
4086
#[ rustc_intrinsic]
4003
4087
pub const fn maxnumf64 ( x : f64 , y : f64 ) -> f64 ;
4004
4088
4005
- /// Returns the maximum of two `f128` values.
4089
+ /// Returns the maximum (IEEE 754-2008 maxNum) of two `f128` values.
4006
4090
///
4007
4091
/// Note that, unlike most intrinsics, this is safe to call;
4008
4092
/// it does not require an `unsafe` block.
@@ -4015,6 +4099,86 @@ pub const fn maxnumf64(x: f64, y: f64) -> f64;
4015
4099
#[ rustc_intrinsic]
4016
4100
pub const fn maxnumf128 ( x : f128 , y : f128 ) -> f128 ;
4017
4101
4102
+ /// Returns the maximum (IEEE 754-2019 maximum) of two `f16` values.
4103
+ ///
4104
+ /// Note that, unlike most intrinsics, this is safe to call;
4105
+ /// it does not require an `unsafe` block.
4106
+ /// Therefore, implementations must not require the user to uphold
4107
+ /// any safety invariants.
4108
+ #[ rustc_nounwind]
4109
+ #[ cfg_attr( not( bootstrap) , rustc_intrinsic) ]
4110
+ pub const fn maximumf16 ( x : f16 , y : f16 ) -> f16 {
4111
+ if x > y {
4112
+ x
4113
+ } else if y > x {
4114
+ y
4115
+ } else if x == y {
4116
+ if x. is_sign_positive ( ) && y. is_sign_negative ( ) { x } else { y }
4117
+ } else {
4118
+ x + y
4119
+ }
4120
+ }
4121
+
4122
+ /// Returns the maximum (IEEE 754-2019 maximum) of two `f32` values.
4123
+ ///
4124
+ /// Note that, unlike most intrinsics, this is safe to call;
4125
+ /// it does not require an `unsafe` block.
4126
+ /// Therefore, implementations must not require the user to uphold
4127
+ /// any safety invariants.
4128
+ #[ rustc_nounwind]
4129
+ #[ cfg_attr( not( bootstrap) , rustc_intrinsic) ]
4130
+ pub const fn maximumf32 ( x : f32 , y : f32 ) -> f32 {
4131
+ if x > y {
4132
+ x
4133
+ } else if y > x {
4134
+ y
4135
+ } else if x == y {
4136
+ if x. is_sign_positive ( ) && y. is_sign_negative ( ) { x } else { y }
4137
+ } else {
4138
+ x + y
4139
+ }
4140
+ }
4141
+
4142
+ /// Returns the maximum (IEEE 754-2019 maximum) of two `f64` values.
4143
+ ///
4144
+ /// Note that, unlike most intrinsics, this is safe to call;
4145
+ /// it does not require an `unsafe` block.
4146
+ /// Therefore, implementations must not require the user to uphold
4147
+ /// any safety invariants.
4148
+ #[ rustc_nounwind]
4149
+ #[ cfg_attr( not( bootstrap) , rustc_intrinsic) ]
4150
+ pub const fn maximumf64 ( x : f64 , y : f64 ) -> f64 {
4151
+ if x > y {
4152
+ x
4153
+ } else if y > x {
4154
+ y
4155
+ } else if x == y {
4156
+ if x. is_sign_positive ( ) && y. is_sign_negative ( ) { x } else { y }
4157
+ } else {
4158
+ x + y
4159
+ }
4160
+ }
4161
+
4162
+ /// Returns the maximum (IEEE 754-2019 maximum) of two `f128` values.
4163
+ ///
4164
+ /// Note that, unlike most intrinsics, this is safe to call;
4165
+ /// it does not require an `unsafe` block.
4166
+ /// Therefore, implementations must not require the user to uphold
4167
+ /// any safety invariants.
4168
+ #[ rustc_nounwind]
4169
+ #[ cfg_attr( not( bootstrap) , rustc_intrinsic) ]
4170
+ pub const fn maximumf128 ( x : f128 , y : f128 ) -> f128 {
4171
+ if x > y {
4172
+ x
4173
+ } else if y > x {
4174
+ y
4175
+ } else if x == y {
4176
+ if x. is_sign_positive ( ) && y. is_sign_negative ( ) { x } else { y }
4177
+ } else {
4178
+ x + y
4179
+ }
4180
+ }
4181
+
4018
4182
/// Returns the absolute value of an `f16`.
4019
4183
///
4020
4184
/// The stabilized version of this intrinsic is
0 commit comments