@@ -833,6 +833,26 @@ pub unsafe fn vceqq_s32(a: int32x4_t, b: int32x4_t) -> uint32x4_t {
833833 simd_eq ( a, b)
834834}
835835
836+ /// Compare bitwise Equal (vector)
837+ #[ inline]
838+ #[ target_feature( enable = "neon" ) ]
839+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
840+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "vceq.i8" ) ) ]
841+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( cmeq) ) ]
842+ pub unsafe fn vceq_p8 ( a : poly8x8_t , b : poly8x8_t ) -> uint8x8_t {
843+ simd_eq ( a, b)
844+ }
845+
846+ /// Compare bitwise Equal (vector)
847+ #[ inline]
848+ #[ target_feature( enable = "neon" ) ]
849+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
850+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( "vceq.i8" ) ) ]
851+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( cmeq) ) ]
852+ pub unsafe fn vceqq_p8 ( a : poly8x16_t , b : poly8x16_t ) -> uint8x16_t {
853+ simd_eq ( a, b)
854+ }
855+
836856/// Floating-point compare equal
837857#[ inline]
838858#[ target_feature( enable = "neon" ) ]
@@ -925,6 +945,30 @@ pub unsafe fn vtstq_s32(a: int32x4_t, b: int32x4_t) -> uint32x4_t {
925945 simd_ne ( c, transmute ( d) )
926946}
927947
948+ /// Signed compare bitwise Test bits nonzero
949+ #[ inline]
950+ #[ target_feature( enable = "neon" ) ]
951+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
952+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( vtst) ) ]
953+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( cmtst) ) ]
954+ pub unsafe fn vtst_p8 ( a : poly8x8_t , b : poly8x8_t ) -> uint8x8_t {
955+ let c: poly8x8_t = simd_and ( a, b) ;
956+ let d: i8x8 = i8x8:: new ( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ) ;
957+ simd_ne ( c, transmute ( d) )
958+ }
959+
960+ /// Signed compare bitwise Test bits nonzero
961+ #[ inline]
962+ #[ target_feature( enable = "neon" ) ]
963+ #[ cfg_attr( target_arch = "arm" , target_feature( enable = "v7" ) ) ]
964+ #[ cfg_attr( all( test, target_arch = "arm" ) , assert_instr( vtst) ) ]
965+ #[ cfg_attr( all( test, target_arch = "aarch64" ) , assert_instr( cmtst) ) ]
966+ pub unsafe fn vtstq_p8 ( a : poly8x16_t , b : poly8x16_t ) -> uint8x16_t {
967+ let c: poly8x16_t = simd_and ( a, b) ;
968+ let d: i8x16 = i8x16:: new ( 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ) ;
969+ simd_ne ( c, transmute ( d) )
970+ }
971+
928972/// Unsigned compare bitwise Test bits nonzero
929973#[ inline]
930974#[ target_feature( enable = "neon" ) ]
@@ -4147,6 +4191,36 @@ mod test {
41474191 assert_eq ! ( r, e) ;
41484192 }
41494193
4194+ #[ simd_test( enable = "neon" ) ]
4195+ unsafe fn test_vceq_p8 ( ) {
4196+ let a: i8x8 = i8x8:: new ( -128 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 ) ;
4197+ let b: i8x8 = i8x8:: new ( -128 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 ) ;
4198+ let e: u8x8 = u8x8:: new ( 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ) ;
4199+ let r: u8x8 = transmute ( vceq_p8 ( transmute ( a) , transmute ( b) ) ) ;
4200+ assert_eq ! ( r, e) ;
4201+
4202+ let a: i8x8 = i8x8:: new ( -128 , -128 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 ) ;
4203+ let b: i8x8 = i8x8:: new ( -128 , 0x7F , 0x02 , 0x04 , 0x04 , 0x00 , 0x06 , 0x08 ) ;
4204+ let e: u8x8 = u8x8:: new ( 0xFF , 0 , 0xFF , 0 , 0xFF , 0 , 0xFF , 0 ) ;
4205+ let r: u8x8 = transmute ( vceq_p8 ( transmute ( a) , transmute ( b) ) ) ;
4206+ assert_eq ! ( r, e) ;
4207+ }
4208+
4209+ #[ simd_test( enable = "neon" ) ]
4210+ unsafe fn test_vceqq_p8 ( ) {
4211+ let a: i8x16 = i8x16:: new ( -128 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 , 0x09 , 0x0A , 0x0B , 0x0C , 0x0D , 0x0E , 0x7F ) ;
4212+ let b: i8x16 = i8x16:: new ( -128 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 , 0x09 , 0x0A , 0x0B , 0x0C , 0x0D , 0x0E , 0x7F ) ;
4213+ let e: u8x16 = u8x16:: new ( 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ) ;
4214+ let r: u8x16 = transmute ( vceqq_p8 ( transmute ( a) , transmute ( b) ) ) ;
4215+ assert_eq ! ( r, e) ;
4216+
4217+ let a: i8x16 = i8x16:: new ( -128 , -128 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 , 0x09 , 0x0A , 0x0B , 0xCC , 0x0D , 0xEE , 0x7F ) ;
4218+ let b: i8x16 = i8x16:: new ( -128 , 0x7F , 0x02 , 0x04 , 0x04 , 0x00 , 0x06 , 0x08 , 0x08 , 0x00 , 0x0A , 0x0A , 0xCC , 0xD0 , 0xEE , -128 ) ;
4219+ let e: u8x16 = u8x16:: new ( 0xFF , 0 , 0xFF , 0 , 0xFF , 0 , 0xFF , 0 , 0xFF , 0 , 0xFF , 0 , 0xFF , 0 , 0xFF , 0 ) ;
4220+ let r: u8x16 = transmute ( vceqq_p8 ( transmute ( a) , transmute ( b) ) ) ;
4221+ assert_eq ! ( r, e) ;
4222+ }
4223+
41504224 #[ simd_test( enable = "neon" ) ]
41514225 unsafe fn test_vceq_f32 ( ) {
41524226 let a: f32x2 = f32x2:: new ( 1.2 , 3.4 ) ;
@@ -4219,6 +4293,24 @@ mod test {
42194293 assert_eq ! ( r, e) ;
42204294 }
42214295
4296+ #[ simd_test( enable = "neon" ) ]
4297+ unsafe fn test_vtst_p8 ( ) {
4298+ let a: i8x8 = i8x8:: new ( -128 , 0x00 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 ) ;
4299+ let b: i8x8 = i8x8:: new ( -128 , 0x00 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 ) ;
4300+ let e: u8x8 = u8x8:: new ( 0xFF , 0 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ) ;
4301+ let r: u8x8 = transmute ( vtst_p8 ( transmute ( a) , transmute ( b) ) ) ;
4302+ assert_eq ! ( r, e) ;
4303+ }
4304+
4305+ #[ simd_test( enable = "neon" ) ]
4306+ unsafe fn test_vtstq_p8 ( ) {
4307+ let a: i8x16 = i8x16:: new ( -128 , 0x00 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 , 0x09 , 0x0A , 0x0B , 0x0C , 0x0D , 0x7F ) ;
4308+ let b: i8x16 = i8x16:: new ( -128 , 0x00 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 , 0x09 , 0x0A , 0x0B , 0x0C , 0x0D , 0x7F ) ;
4309+ let e: u8x16 = u8x16:: new ( 0xFF , 0 , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ) ;
4310+ let r: u8x16 = transmute ( vtstq_p8 ( transmute ( a) , transmute ( b) ) ) ;
4311+ assert_eq ! ( r, e) ;
4312+ }
4313+
42224314 #[ simd_test( enable = "neon" ) ]
42234315 unsafe fn test_vtst_u8 ( ) {
42244316 let a: u8x8 = u8x8:: new ( 0 , 0x00 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 ) ;
0 commit comments