@@ -1477,102 +1477,6 @@ pub unsafe fn vhaddq_u32(a: uint32x4_t, b: uint32x4_t) -> uint32x4_t {
14771477vhaddq_u32_ ( a, b)
14781478}
14791479
1480- /// Halving add
1481- #[ inline]
1482- #[ target_feature( enable = "neon" ) ]
1483- #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
1484- #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "vhadd.s8" ) ) ]
1485- #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( shadd) ) ]
1486- pub unsafe fn vhadd_s8 ( a : int8x8_t , b : int8x8_t ) -> int8x8_t {
1487- #[ allow( improper_ctypes) ]
1488- extern "C" {
1489- #[ cfg_attr( target_arch = "arm" , link_name = "llvm.arm.neon.vhaddu.v8i8" ) ]
1490- #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.shadd.v8i8" ) ]
1491- fn vhadd_s8_ ( a : int8x8_t , b : int8x8_t ) -> int8x8_t ;
1492- }
1493- vhadd_s8_ ( a, b)
1494- }
1495-
1496- /// Halving add
1497- #[ inline]
1498- #[ target_feature( enable = "neon" ) ]
1499- #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
1500- #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "vhadd.s8" ) ) ]
1501- #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( shadd) ) ]
1502- pub unsafe fn vhaddq_s8 ( a : int8x16_t , b : int8x16_t ) -> int8x16_t {
1503- #[ allow( improper_ctypes) ]
1504- extern "C" {
1505- #[ cfg_attr( target_arch = "arm" , link_name = "llvm.arm.neon.vhaddu.v16i8" ) ]
1506- #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.shadd.v16i8" ) ]
1507- fn vhaddq_s8_ ( a : int8x16_t , b : int8x16_t ) -> int8x16_t ;
1508- }
1509- vhaddq_s8_ ( a, b)
1510- }
1511-
1512- /// Halving add
1513- #[ inline]
1514- #[ target_feature( enable = "neon" ) ]
1515- #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
1516- #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "vhadd.s16" ) ) ]
1517- #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( shadd) ) ]
1518- pub unsafe fn vhadd_s16 ( a : int16x4_t , b : int16x4_t ) -> int16x4_t {
1519- #[ allow( improper_ctypes) ]
1520- extern "C" {
1521- #[ cfg_attr( target_arch = "arm" , link_name = "llvm.arm.neon.vhaddu.v4i16" ) ]
1522- #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.shadd.v4i16" ) ]
1523- fn vhadd_s16_ ( a : int16x4_t , b : int16x4_t ) -> int16x4_t ;
1524- }
1525- vhadd_s16_ ( a, b)
1526- }
1527-
1528- /// Halving add
1529- #[ inline]
1530- #[ target_feature( enable = "neon" ) ]
1531- #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
1532- #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "vhadd.s16" ) ) ]
1533- #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( shadd) ) ]
1534- pub unsafe fn vhaddq_s16 ( a : int16x8_t , b : int16x8_t ) -> int16x8_t {
1535- #[ allow( improper_ctypes) ]
1536- extern "C" {
1537- #[ cfg_attr( target_arch = "arm" , link_name = "llvm.arm.neon.vhaddu.v8i16" ) ]
1538- #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.shadd.v8i16" ) ]
1539- fn vhaddq_s16_ ( a : int16x8_t , b : int16x8_t ) -> int16x8_t ;
1540- }
1541- vhaddq_s16_ ( a, b)
1542- }
1543-
1544- /// Halving add
1545- #[ inline]
1546- #[ target_feature( enable = "neon" ) ]
1547- #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
1548- #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "vhadd.s32" ) ) ]
1549- #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( shadd) ) ]
1550- pub unsafe fn vhadd_s32 ( a : int32x2_t , b : int32x2_t ) -> int32x2_t {
1551- #[ allow( improper_ctypes) ]
1552- extern "C" {
1553- #[ cfg_attr( target_arch = "arm" , link_name = "llvm.arm.neon.vhaddu.v2i32" ) ]
1554- #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.shadd.v2i32" ) ]
1555- fn vhadd_s32_ ( a : int32x2_t , b : int32x2_t ) -> int32x2_t ;
1556- }
1557- vhadd_s32_ ( a, b)
1558- }
1559-
1560- /// Halving add
1561- #[ inline]
1562- #[ target_feature( enable = "neon" ) ]
1563- #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
1564- #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "vhadd.s32" ) ) ]
1565- #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( shadd) ) ]
1566- pub unsafe fn vhaddq_s32 ( a : int32x4_t , b : int32x4_t ) -> int32x4_t {
1567- #[ allow( improper_ctypes) ]
1568- extern "C" {
1569- #[ cfg_attr( target_arch = "arm" , link_name = "llvm.arm.neon.vhaddu.v4i32" ) ]
1570- #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.shadd.v4i32" ) ]
1571- fn vhaddq_s32_ ( a : int32x4_t , b : int32x4_t ) -> int32x4_t ;
1572- }
1573- vhaddq_s32_ ( a, b)
1574- }
1575-
15761480/// Halving add
15771481#[ inline]
15781482#[ target_feature( enable = "neon" ) ]
@@ -4019,60 +3923,6 @@ mod test {
40193923 assert_eq ! ( r, e) ;
40203924 }
40213925
4022- #[ simd_test( enable = "neon" ) ]
4023- unsafe fn test_vhadd_s8 ( ) {
4024- let a: i8x8 = i8x8:: new ( 42 , 42 , 42 , 42 , 42 , 42 , 42 , 42 ) ;
4025- let b: i8x8 = i8x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
4026- let e: i8x8 = i8x8:: new ( 21 , 22 , 22 , 23 , 23 , 24 , 24 , 25 ) ;
4027- let r: i8x8 = transmute ( vhadd_s8 ( transmute ( a) , transmute ( b) ) ) ;
4028- assert_eq ! ( r, e) ;
4029- }
4030-
4031- #[ simd_test( enable = "neon" ) ]
4032- unsafe fn test_vhaddq_s8 ( ) {
4033- let a: i8x16 = i8x16:: new ( 42 , 42 , 42 , 42 , 42 , 42 , 42 , 42 , 42 , 42 , 42 , 42 , 42 , 42 , 42 , 42 ) ;
4034- let b: i8x16 = i8x16:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 , 11 , 12 , 13 , 14 , 15 , 16 ) ;
4035- let e: i8x16 = i8x16:: new ( 21 , 22 , 22 , 23 , 23 , 24 , 24 , 25 , 25 , 26 , 26 , 27 , 27 , 28 , 28 , 29 ) ;
4036- let r: i8x16 = transmute ( vhaddq_s8 ( transmute ( a) , transmute ( b) ) ) ;
4037- assert_eq ! ( r, e) ;
4038- }
4039-
4040- #[ simd_test( enable = "neon" ) ]
4041- unsafe fn test_vhadd_s16 ( ) {
4042- let a: i16x4 = i16x4:: new ( 42 , 42 , 42 , 42 ) ;
4043- let b: i16x4 = i16x4:: new ( 1 , 2 , 3 , 4 ) ;
4044- let e: i16x4 = i16x4:: new ( 21 , 22 , 22 , 23 ) ;
4045- let r: i16x4 = transmute ( vhadd_s16 ( transmute ( a) , transmute ( b) ) ) ;
4046- assert_eq ! ( r, e) ;
4047- }
4048-
4049- #[ simd_test( enable = "neon" ) ]
4050- unsafe fn test_vhaddq_s16 ( ) {
4051- let a: i16x8 = i16x8:: new ( 42 , 42 , 42 , 42 , 42 , 42 , 42 , 42 ) ;
4052- let b: i16x8 = i16x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
4053- let e: i16x8 = i16x8:: new ( 21 , 22 , 22 , 23 , 23 , 24 , 24 , 25 ) ;
4054- let r: i16x8 = transmute ( vhaddq_s16 ( transmute ( a) , transmute ( b) ) ) ;
4055- assert_eq ! ( r, e) ;
4056- }
4057-
4058- #[ simd_test( enable = "neon" ) ]
4059- unsafe fn test_vhadd_s32 ( ) {
4060- let a: i32x2 = i32x2:: new ( 42 , 42 ) ;
4061- let b: i32x2 = i32x2:: new ( 1 , 2 ) ;
4062- let e: i32x2 = i32x2:: new ( 21 , 22 ) ;
4063- let r: i32x2 = transmute ( vhadd_s32 ( transmute ( a) , transmute ( b) ) ) ;
4064- assert_eq ! ( r, e) ;
4065- }
4066-
4067- #[ simd_test( enable = "neon" ) ]
4068- unsafe fn test_vhaddq_s32 ( ) {
4069- let a: i32x4 = i32x4:: new ( 42 , 42 , 42 , 42 ) ;
4070- let b: i32x4 = i32x4:: new ( 1 , 2 , 3 , 4 ) ;
4071- let e: i32x4 = i32x4:: new ( 21 , 22 , 22 , 23 ) ;
4072- let r: i32x4 = transmute ( vhaddq_s32 ( transmute ( a) , transmute ( b) ) ) ;
4073- assert_eq ! ( r, e) ;
4074- }
4075-
40763926 #[ simd_test( enable = "neon" ) ]
40773927 unsafe fn test_vrhadd_u8 ( ) {
40783928 let a: u8x8 = u8x8:: new ( 42 , 42 , 42 , 42 , 42 , 42 , 42 , 42 ) ;
0 commit comments