File tree Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Expand file tree Collapse file tree 2 files changed +6
-10
lines changed Original file line number Diff line number Diff line change @@ -46,6 +46,10 @@ extern "platform-intrinsic" {
4646 /// fabs
4747 pub ( crate ) fn simd_fabs < T > ( x : T ) -> T ;
4848
49+ // minnum/maxnum
50+ pub ( crate ) fn simd_fmin < T > ( x : T , y : T ) -> T ;
51+ pub ( crate ) fn simd_fmax < T > ( x : T , y : T ) -> T ;
52+
4953 pub ( crate ) fn simd_eq < T , U > ( x : T , y : T ) -> U ;
5054 pub ( crate ) fn simd_ne < T , U > ( x : T , y : T ) -> U ;
5155 pub ( crate ) fn simd_lt < T , U > ( x : T , y : T ) -> U ;
Original file line number Diff line number Diff line change @@ -141,11 +141,7 @@ macro_rules! impl_float_vector {
141141 #[ inline]
142142 #[ must_use = "method returns a new vector and does not mutate the original value" ]
143143 pub fn min( self , other: Self ) -> Self {
144- // TODO consider using an intrinsic
145- self . is_nan( ) . select(
146- other,
147- self . lanes_ge( other) . select( other, self )
148- )
144+ unsafe { intrinsics:: simd_fmin( self , other) }
149145 }
150146
151147 /// Returns the maximum of each lane.
@@ -154,11 +150,7 @@ macro_rules! impl_float_vector {
154150 #[ inline]
155151 #[ must_use = "method returns a new vector and does not mutate the original value" ]
156152 pub fn max( self , other: Self ) -> Self {
157- // TODO consider using an intrinsic
158- self . is_nan( ) . select(
159- other,
160- self . lanes_le( other) . select( other, self )
161- )
153+ unsafe { intrinsics:: simd_fmax( self , other) }
162154 }
163155
164156 /// Restrict each lane to a certain interval unless it is NaN.
You can’t perform that action at this time.
0 commit comments