@@ -833,6 +833,26 @@ pub unsafe fn vceqq_s32(a: int32x4_t, b: int32x4_t) -> uint32x4_t {
833
833
simd_eq ( a, b)
834
834
}
835
835
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
+
836
856
/// Floating-point compare equal
837
857
#[ inline]
838
858
#[ target_feature( enable = "neon" ) ]
@@ -925,6 +945,30 @@ pub unsafe fn vtstq_s32(a: int32x4_t, b: int32x4_t) -> uint32x4_t {
925
945
simd_ne ( c, transmute ( d) )
926
946
}
927
947
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
+
928
972
/// Unsigned compare bitwise Test bits nonzero
929
973
#[ inline]
930
974
#[ target_feature( enable = "neon" ) ]
@@ -4147,6 +4191,36 @@ mod test {
4147
4191
assert_eq ! ( r, e) ;
4148
4192
}
4149
4193
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
+
4150
4224
#[ simd_test( enable = "neon" ) ]
4151
4225
unsafe fn test_vceq_f32 ( ) {
4152
4226
let a: f32x2 = f32x2:: new ( 1.2 , 3.4 ) ;
@@ -4219,6 +4293,24 @@ mod test {
4219
4293
assert_eq ! ( r, e) ;
4220
4294
}
4221
4295
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
+
4222
4314
#[ simd_test( enable = "neon" ) ]
4223
4315
unsafe fn test_vtst_u8 ( ) {
4224
4316
let a: u8x8 = u8x8:: new ( 0 , 0x00 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 ) ;
0 commit comments