@@ -188,6 +188,13 @@ extern "C" {
188
188
#[ cfg_attr( target_arch = "arm" , link_name = "llvm.arm.neon.vpadd.v16i8" ) ]
189
189
#[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.addp.v16i8" ) ]
190
190
fn vpaddq_s8_ ( a : int8x16_t , b : int8x16_t ) -> int8x16_t ;
191
+
192
+ #[ cfg_attr( target_arch = "arm" , link_name = "llvm.arm.neon.vmaxs.v4f32" ) ]
193
+ #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.fmax.v4f32" ) ]
194
+ fn vmaxq_f32_ ( a : float32x4_t , b : float32x4_t ) -> float32x4_t ;
195
+ #[ cfg_attr( target_arch = "arm" , link_name = "llvm.arm.neon.vmins.v4f32" ) ]
196
+ #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.fmin.v4f32" ) ]
197
+ fn vminq_f32_ ( a : float32x4_t , b : float32x4_t ) -> float32x4_t ;
191
198
}
192
199
193
200
#[ cfg( target_arch = "arm" ) ]
@@ -1836,6 +1843,26 @@ pub unsafe fn vcvtq_u32_f32(a: float32x4_t) -> uint32x4_t {
1836
1843
transmute ( simd_cast :: < _ , u32x4 > ( transmute :: < _ , f32x4 > ( a) ) )
1837
1844
}
1838
1845
1846
+ /// Floating-point minimum (vector).
1847
+ #[ inline]
1848
+ #[ target_feature( enable = "neon" ) ]
1849
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
1850
+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "vmin.f32" ) ) ]
1851
+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( fmin) ) ]
1852
+ pub unsafe fn vminq_f32 ( a : float32x4_t , b : float32x4_t ) -> float32x4_t {
1853
+ vminq_f32_ ( a, b)
1854
+ }
1855
+
1856
+ /// Floating-point maxmimum (vector).
1857
+ #[ inline]
1858
+ #[ target_feature( enable = "neon" ) ]
1859
+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
1860
+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "vmax.f32" ) ) ]
1861
+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( fmax) ) ]
1862
+ pub unsafe fn vmaxq_f32 ( a : float32x4_t , b : float32x4_t ) -> float32x4_t {
1863
+ vmaxq_f32_ ( a, b)
1864
+ }
1865
+
1839
1866
#[ cfg( test) ]
1840
1867
mod tests {
1841
1868
use super :: * ;
@@ -4314,6 +4341,22 @@ mod tests {
4314
4341
let e = u8x8:: new ( 3 , 7 , 11 , 15 , 61 , 65 , 69 , 73 ) ;
4315
4342
assert_eq ! ( r, e) ;
4316
4343
}
4344
+ #[ simd_test( enable = "neon" ) ]
4345
+ unsafe fn test_vminq_f32 ( ) {
4346
+ let a = f32x4:: new ( 1. , -2. , 3. , -4. ) ;
4347
+ let b = f32x4:: new ( 0. , 3. , 2. , 8. ) ;
4348
+ let e = f32x4:: new ( 0. , -2. , 2. , -4. ) ;
4349
+ let r: f32x4 = transmute ( vminq_f32 ( transmute ( a) , transmute ( b) ) ) ;
4350
+ assert_eq ! ( r, e) ;
4351
+ }
4352
+ #[ simd_test( enable = "neon" ) ]
4353
+ unsafe fn test_vmaxq_f32 ( ) {
4354
+ let a = f32x4:: new ( 1. , -2. , 3. , -4. ) ;
4355
+ let b = f32x4:: new ( 0. , 3. , 2. , 8. ) ;
4356
+ let e = f32x4:: new ( 1. , 3. , 3. , 8. ) ;
4357
+ let r: f32x4 = transmute ( vmaxq_f32 ( transmute ( a) , transmute ( b) ) ) ;
4358
+ assert_eq ! ( r, e) ;
4359
+ }
4317
4360
}
4318
4361
4319
4362
#[ cfg( test) ]
0 commit comments