@@ -1753,6 +1753,64 @@ pub unsafe fn vmlsl_high_u32(a: uint64x2_t, b: uint32x4_t, c: uint32x4_t) -> uin
17531753 vmlsl_u32 ( a, b, c)
17541754}
17551755
1756+ /// Negate
1757+ #[ inline]
1758+ #[ target_feature( enable = "neon" ) ]
1759+ #[ cfg_attr( test, assert_instr( neg) ) ]
1760+ pub unsafe fn vneg_s64 ( a : int64x1_t ) -> int64x1_t {
1761+ simd_neg ( a)
1762+ }
1763+
1764+ /// Negate
1765+ #[ inline]
1766+ #[ target_feature( enable = "neon" ) ]
1767+ #[ cfg_attr( test, assert_instr( neg) ) ]
1768+ pub unsafe fn vnegq_s64 ( a : int64x2_t ) -> int64x2_t {
1769+ simd_neg ( a)
1770+ }
1771+
1772+ /// Negate
1773+ #[ inline]
1774+ #[ target_feature( enable = "neon" ) ]
1775+ #[ cfg_attr( test, assert_instr( fneg) ) ]
1776+ pub unsafe fn vneg_f64 ( a : float64x1_t ) -> float64x1_t {
1777+ simd_neg ( a)
1778+ }
1779+
1780+ /// Negate
1781+ #[ inline]
1782+ #[ target_feature( enable = "neon" ) ]
1783+ #[ cfg_attr( test, assert_instr( fneg) ) ]
1784+ pub unsafe fn vnegq_f64 ( a : float64x2_t ) -> float64x2_t {
1785+ simd_neg ( a)
1786+ }
1787+
1788+ /// Signed saturating negate
1789+ #[ inline]
1790+ #[ target_feature( enable = "neon" ) ]
1791+ #[ cfg_attr( test, assert_instr( sqneg) ) ]
1792+ pub unsafe fn vqneg_s64 ( a : int64x1_t ) -> int64x1_t {
1793+ #[ allow( improper_ctypes) ]
1794+ extern "C" {
1795+ #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.sqneg.v1i64" ) ]
1796+ fn vqneg_s64_ ( a : int64x1_t ) -> int64x1_t ;
1797+ }
1798+ vqneg_s64_ ( a)
1799+ }
1800+
1801+ /// Signed saturating negate
1802+ #[ inline]
1803+ #[ target_feature( enable = "neon" ) ]
1804+ #[ cfg_attr( test, assert_instr( sqneg) ) ]
1805+ pub unsafe fn vqnegq_s64 ( a : int64x2_t ) -> int64x2_t {
1806+ #[ allow( improper_ctypes) ]
1807+ extern "C" {
1808+ #[ cfg_attr( target_arch = "aarch64" , link_name = "llvm.aarch64.neon.sqneg.v2i64" ) ]
1809+ fn vqnegq_s64_ ( a : int64x2_t ) -> int64x2_t ;
1810+ }
1811+ vqnegq_s64_ ( a)
1812+ }
1813+
17561814/// Multiply
17571815#[ inline]
17581816#[ target_feature( enable = "neon" ) ]
@@ -4361,6 +4419,54 @@ mod test {
43614419 assert_eq ! ( r, e) ;
43624420 }
43634421
4422+ #[ simd_test( enable = "neon" ) ]
4423+ unsafe fn test_vneg_s64 ( ) {
4424+ let a: i64x1 = i64x1:: new ( 0 ) ;
4425+ let e: i64x1 = i64x1:: new ( 0 ) ;
4426+ let r: i64x1 = transmute ( vneg_s64 ( transmute ( a) ) ) ;
4427+ assert_eq ! ( r, e) ;
4428+ }
4429+
4430+ #[ simd_test( enable = "neon" ) ]
4431+ unsafe fn test_vnegq_s64 ( ) {
4432+ let a: i64x2 = i64x2:: new ( 0 , 1 ) ;
4433+ let e: i64x2 = i64x2:: new ( 0 , -1 ) ;
4434+ let r: i64x2 = transmute ( vnegq_s64 ( transmute ( a) ) ) ;
4435+ assert_eq ! ( r, e) ;
4436+ }
4437+
4438+ #[ simd_test( enable = "neon" ) ]
4439+ unsafe fn test_vneg_f64 ( ) {
4440+ let a: f64 = 0. ;
4441+ let e: f64 = 0. ;
4442+ let r: f64 = transmute ( vneg_f64 ( transmute ( a) ) ) ;
4443+ assert_eq ! ( r, e) ;
4444+ }
4445+
4446+ #[ simd_test( enable = "neon" ) ]
4447+ unsafe fn test_vnegq_f64 ( ) {
4448+ let a: f64x2 = f64x2:: new ( 0. , 1. ) ;
4449+ let e: f64x2 = f64x2:: new ( 0. , -1. ) ;
4450+ let r: f64x2 = transmute ( vnegq_f64 ( transmute ( a) ) ) ;
4451+ assert_eq ! ( r, e) ;
4452+ }
4453+
4454+ #[ simd_test( enable = "neon" ) ]
4455+ unsafe fn test_vqneg_s64 ( ) {
4456+ let a: i64x1 = i64x1:: new ( -9223372036854775808 ) ;
4457+ let e: i64x1 = i64x1:: new ( 0x7F_FF_FF_FF_FF_FF_FF_FF ) ;
4458+ let r: i64x1 = transmute ( vqneg_s64 ( transmute ( a) ) ) ;
4459+ assert_eq ! ( r, e) ;
4460+ }
4461+
4462+ #[ simd_test( enable = "neon" ) ]
4463+ unsafe fn test_vqnegq_s64 ( ) {
4464+ let a: i64x2 = i64x2:: new ( -9223372036854775808 , 0 ) ;
4465+ let e: i64x2 = i64x2:: new ( 0x7F_FF_FF_FF_FF_FF_FF_FF , 0 ) ;
4466+ let r: i64x2 = transmute ( vqnegq_s64 ( transmute ( a) ) ) ;
4467+ assert_eq ! ( r, e) ;
4468+ }
4469+
43644470 #[ simd_test( enable = "neon" ) ]
43654471 unsafe fn test_vmul_f64 ( ) {
43664472 let a: f64 = 1.0 ;
0 commit comments