@@ -1157,52 +1157,32 @@ pub unsafe fn vcvtx_high_f32_f64(a: float32x2_t, b: float64x2_t) -> float32x4_t
11571157#[ inline]
11581158#[ target_feature( enable = "neon" ) ]
11591159#[ cfg_attr( test, assert_instr( fcvtzs) ) ]
1160- pub unsafe fn vcvt_s32_f32 ( a : float32x2_t ) -> int32x2_t {
1161- #[ allow( improper_ctypes) ]
1162- extern "C" {
1163- #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.fcvtzs.v2i32.v2f32" ) ]
1164- fn vcvt_s32_f32_ ( a : float32x2_t ) -> int32x2_t ;
1165- }
1166- vcvt_s32_f32_ ( a)
1160+ pub unsafe fn vcvt_s64_f64 ( a : float64x1_t ) -> int64x1_t {
1161+ simd_cast ( a)
11671162}
11681163
11691164/// Floating-point convert to signed fixed-point, rounding toward zero
11701165#[ inline]
11711166#[ target_feature( enable = "neon" ) ]
11721167#[ cfg_attr( test, assert_instr( fcvtzs) ) ]
1173- pub unsafe fn vcvtq_s32_f32 ( a : float32x4_t ) -> int32x4_t {
1174- #[ allow( improper_ctypes) ]
1175- extern "C" {
1176- #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.fcvtzs.v4i32.v4f32" ) ]
1177- fn vcvtq_s32_f32_ ( a : float32x4_t ) -> int32x4_t ;
1178- }
1179- vcvtq_s32_f32_ ( a)
1168+ pub unsafe fn vcvtq_s64_f64 ( a : float64x2_t ) -> int64x2_t {
1169+ simd_cast ( a)
11801170}
11811171
1182- /// Floating-point convert to signed fixed-point, rounding toward zero
1172+ /// Floating-point convert to unsigned fixed-point, rounding toward zero
11831173#[ inline]
11841174#[ target_feature( enable = "neon" ) ]
11851175#[ cfg_attr( test, assert_instr( fcvtzs) ) ]
1186- pub unsafe fn vcvt_s64_f64 ( a : float64x1_t ) -> int64x1_t {
1187- #[ allow( improper_ctypes) ]
1188- extern "C" {
1189- #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.fcvtzs.v1i64.v1f64" ) ]
1190- fn vcvt_s64_f64_ ( a : float64x1_t ) -> int64x1_t ;
1191- }
1192- vcvt_s64_f64_ ( a)
1176+ pub unsafe fn vcvt_u64_f64 ( a : float64x1_t ) -> uint64x1_t {
1177+ simd_cast ( a)
11931178}
11941179
1195- /// Floating-point convert to signed fixed-point, rounding toward zero
1180+ /// Floating-point convert to unsigned fixed-point, rounding toward zero
11961181#[ inline]
11971182#[ target_feature( enable = "neon" ) ]
11981183#[ cfg_attr( test, assert_instr( fcvtzs) ) ]
1199- pub unsafe fn vcvtq_s64_f64 ( a : float64x2_t ) -> int64x2_t {
1200- #[ allow( improper_ctypes) ]
1201- extern "C" {
1202- #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.fcvtzs.v2i64.v2f64" ) ]
1203- fn vcvtq_s64_f64_ ( a : float64x2_t ) -> int64x2_t ;
1204- }
1205- vcvtq_s64_f64_ ( a)
1184+ pub unsafe fn vcvtq_u64_f64 ( a : float64x2_t ) -> uint64x2_t {
1185+ simd_cast ( a)
12061186}
12071187
12081188/// Floating-point convert to signed integer, rounding to nearest with ties to away
@@ -1413,58 +1393,6 @@ pub unsafe fn vcvtpq_s64_f64(a: float64x2_t) -> int64x2_t {
14131393 vcvtpq_s64_f64_ ( a)
14141394}
14151395
1416- /// Floating-point convert to unsigned fixed-point, rounding toward zero
1417- #[ inline]
1418- #[ target_feature( enable = "neon" ) ]
1419- #[ cfg_attr( test, assert_instr( fcvtzu) ) ]
1420- pub unsafe fn vcvt_u32_f32 ( a : float32x2_t ) -> uint32x2_t {
1421- #[ allow( improper_ctypes) ]
1422- extern "C" {
1423- #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.fcvtzu.v2i32.v2f32" ) ]
1424- fn vcvt_u32_f32_ ( a : float32x2_t ) -> uint32x2_t ;
1425- }
1426- vcvt_u32_f32_ ( a)
1427- }
1428-
1429- /// Floating-point convert to unsigned fixed-point, rounding toward zero
1430- #[ inline]
1431- #[ target_feature( enable = "neon" ) ]
1432- #[ cfg_attr( test, assert_instr( fcvtzu) ) ]
1433- pub unsafe fn vcvtq_u32_f32 ( a : float32x4_t ) -> uint32x4_t {
1434- #[ allow( improper_ctypes) ]
1435- extern "C" {
1436- #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.fcvtzu.v4i32.v4f32" ) ]
1437- fn vcvtq_u32_f32_ ( a : float32x4_t ) -> uint32x4_t ;
1438- }
1439- vcvtq_u32_f32_ ( a)
1440- }
1441-
1442- /// Floating-point convert to unsigned fixed-point, rounding toward zero
1443- #[ inline]
1444- #[ target_feature( enable = "neon" ) ]
1445- #[ cfg_attr( test, assert_instr( fcvtzu) ) ]
1446- pub unsafe fn vcvt_u64_f64 ( a : float64x1_t ) -> uint64x1_t {
1447- #[ allow( improper_ctypes) ]
1448- extern "C" {
1449- #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.fcvtzu.v1i64.v1f64" ) ]
1450- fn vcvt_u64_f64_ ( a : float64x1_t ) -> uint64x1_t ;
1451- }
1452- vcvt_u64_f64_ ( a)
1453- }
1454-
1455- /// Floating-point convert to unsigned fixed-point, rounding toward zero
1456- #[ inline]
1457- #[ target_feature( enable = "neon" ) ]
1458- #[ cfg_attr( test, assert_instr( fcvtzu) ) ]
1459- pub unsafe fn vcvtq_u64_f64 ( a : float64x2_t ) -> uint64x2_t {
1460- #[ allow( improper_ctypes) ]
1461- extern "C" {
1462- #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.fcvtzu.v2i64.v2f64" ) ]
1463- fn vcvtq_u64_f64_ ( a : float64x2_t ) -> uint64x2_t ;
1464- }
1465- vcvtq_u64_f64_ ( a)
1466- }
1467-
14681396/// Floating-point convert to unsigned integer, rounding to nearest with ties to away
14691397#[ inline]
14701398#[ target_feature( enable = "neon" ) ]
@@ -2990,22 +2918,6 @@ mod test {
29902918 assert_eq ! ( r, e) ;
29912919 }
29922920
2993- #[ simd_test( enable = "neon" ) ]
2994- unsafe fn test_vcvt_s32_f32 ( ) {
2995- let a: f32x2 = f32x2:: new ( -1.0 , 2.0 ) ;
2996- let e: i32x2 = i32x2:: new ( -1 , 2 ) ;
2997- let r: i32x2 = transmute ( vcvt_s32_f32 ( transmute ( a) ) ) ;
2998- assert_eq ! ( r, e) ;
2999- }
3000-
3001- #[ simd_test( enable = "neon" ) ]
3002- unsafe fn test_vcvtq_s32_f32 ( ) {
3003- let a: f32x4 = f32x4:: new ( -1.0 , 2.0 , -3.0 , 4.0 ) ;
3004- let e: i32x4 = i32x4:: new ( -1 , 2 , -3 , 4 ) ;
3005- let r: i32x4 = transmute ( vcvtq_s32_f32 ( transmute ( a) ) ) ;
3006- assert_eq ! ( r, e) ;
3007- }
3008-
30092921 #[ simd_test( enable = "neon" ) ]
30102922 unsafe fn test_vcvt_s64_f64 ( ) {
30112923 let a: f64 = -1.0 ;
@@ -3022,6 +2934,22 @@ mod test {
30222934 assert_eq ! ( r, e) ;
30232935 }
30242936
2937+ #[ simd_test( enable = "neon" ) ]
2938+ unsafe fn test_vcvt_u64_f64 ( ) {
2939+ let a: f64 = 1.0 ;
2940+ let e: u64x1 = u64x1:: new ( 1 ) ;
2941+ let r: u64x1 = transmute ( vcvt_u64_f64 ( transmute ( a) ) ) ;
2942+ assert_eq ! ( r, e) ;
2943+ }
2944+
2945+ #[ simd_test( enable = "neon" ) ]
2946+ unsafe fn test_vcvtq_u64_f64 ( ) {
2947+ let a: f64x2 = f64x2:: new ( 1.0 , 2.0 ) ;
2948+ let e: u64x2 = u64x2:: new ( 1 , 2 ) ;
2949+ let r: u64x2 = transmute ( vcvtq_u64_f64 ( transmute ( a) ) ) ;
2950+ assert_eq ! ( r, e) ;
2951+ }
2952+
30252953 #[ simd_test( enable = "neon" ) ]
30262954 unsafe fn test_vcvta_s32_f32 ( ) {
30272955 let a: f32x2 = f32x2:: new ( -1.0 , 2.0 ) ;
@@ -3150,38 +3078,6 @@ mod test {
31503078 assert_eq ! ( r, e) ;
31513079 }
31523080
3153- #[ simd_test( enable = "neon" ) ]
3154- unsafe fn test_vcvt_u32_f32 ( ) {
3155- let a: f32x2 = f32x2:: new ( 1.0 , 2.0 ) ;
3156- let e: u32x2 = u32x2:: new ( 1 , 2 ) ;
3157- let r: u32x2 = transmute ( vcvt_u32_f32 ( transmute ( a) ) ) ;
3158- assert_eq ! ( r, e) ;
3159- }
3160-
3161- #[ simd_test( enable = "neon" ) ]
3162- unsafe fn test_vcvtq_u32_f32 ( ) {
3163- let a: f32x4 = f32x4:: new ( 1.0 , 2.0 , 3.0 , 4.0 ) ;
3164- let e: u32x4 = u32x4:: new ( 1 , 2 , 3 , 4 ) ;
3165- let r: u32x4 = transmute ( vcvtq_u32_f32 ( transmute ( a) ) ) ;
3166- assert_eq ! ( r, e) ;
3167- }
3168-
3169- #[ simd_test( enable = "neon" ) ]
3170- unsafe fn test_vcvt_u64_f64 ( ) {
3171- let a: f64 = 1.0 ;
3172- let e: u64x1 = u64x1:: new ( 1 ) ;
3173- let r: u64x1 = transmute ( vcvt_u64_f64 ( transmute ( a) ) ) ;
3174- assert_eq ! ( r, e) ;
3175- }
3176-
3177- #[ simd_test( enable = "neon" ) ]
3178- unsafe fn test_vcvtq_u64_f64 ( ) {
3179- let a: f64x2 = f64x2:: new ( 1.0 , 2.0 ) ;
3180- let e: u64x2 = u64x2:: new ( 1 , 2 ) ;
3181- let r: u64x2 = transmute ( vcvtq_u64_f64 ( transmute ( a) ) ) ;
3182- assert_eq ! ( r, e) ;
3183- }
3184-
31853081 #[ simd_test( enable = "neon" ) ]
31863082 unsafe fn test_vcvta_u32_f32 ( ) {
31873083 let a: f32x2 = f32x2:: new ( 1.0 , 2.0 ) ;
0 commit comments