@@ -1157,52 +1157,32 @@ pub unsafe fn vcvtx_high_f32_f64(a: float32x2_t, b: float64x2_t) -> float32x4_t
1157
1157
#[ inline]
1158
1158
#[ target_feature( enable = "neon" ) ]
1159
1159
#[ 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)
1167
1162
}
1168
1163
1169
1164
/// Floating-point convert to signed fixed-point, rounding toward zero
1170
1165
#[ inline]
1171
1166
#[ target_feature( enable = "neon" ) ]
1172
1167
#[ 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)
1180
1170
}
1181
1171
1182
- /// Floating-point convert to signed fixed-point, rounding toward zero
1172
+ /// Floating-point convert to unsigned fixed-point, rounding toward zero
1183
1173
#[ inline]
1184
1174
#[ target_feature( enable = "neon" ) ]
1185
1175
#[ 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)
1193
1178
}
1194
1179
1195
- /// Floating-point convert to signed fixed-point, rounding toward zero
1180
+ /// Floating-point convert to unsigned fixed-point, rounding toward zero
1196
1181
#[ inline]
1197
1182
#[ target_feature( enable = "neon" ) ]
1198
1183
#[ 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)
1206
1186
}
1207
1187
1208
1188
/// 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 {
1413
1393
vcvtpq_s64_f64_ ( a)
1414
1394
}
1415
1395
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
-
1468
1396
/// Floating-point convert to unsigned integer, rounding to nearest with ties to away
1469
1397
#[ inline]
1470
1398
#[ target_feature( enable = "neon" ) ]
@@ -2990,22 +2918,6 @@ mod test {
2990
2918
assert_eq ! ( r, e) ;
2991
2919
}
2992
2920
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
-
3009
2921
#[ simd_test( enable = "neon" ) ]
3010
2922
unsafe fn test_vcvt_s64_f64 ( ) {
3011
2923
let a: f64 = -1.0 ;
@@ -3022,6 +2934,22 @@ mod test {
3022
2934
assert_eq ! ( r, e) ;
3023
2935
}
3024
2936
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
+
3025
2953
#[ simd_test( enable = "neon" ) ]
3026
2954
unsafe fn test_vcvta_s32_f32 ( ) {
3027
2955
let a: f32x2 = f32x2:: new ( -1.0 , 2.0 ) ;
@@ -3150,38 +3078,6 @@ mod test {
3150
3078
assert_eq ! ( r, e) ;
3151
3079
}
3152
3080
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
-
3185
3081
#[ simd_test( enable = "neon" ) ]
3186
3082
unsafe fn test_vcvta_u32_f32 ( ) {
3187
3083
let a: f32x2 = f32x2:: new ( 1.0 , 2.0 ) ;
0 commit comments