@@ -784,7 +784,7 @@ arm_simd_eor!(veorq_u64, uint64x2_t);
784
784
785
785
macro_rules! arm_simd_ceq {
786
786
( $name: ident, $type: ty) => {
787
- /// Vector bitwise exclusive or (vector).
787
+ /// Compare bitwise Equal (vector)
788
788
arm_simd_2!( $name, $type, simd_eq, cmeq, cmeq) ;
789
789
} ;
790
790
}
@@ -802,7 +802,6 @@ arm_simd_ceq!(vceqq_u16, uint16x8_t);
802
802
arm_simd_ceq ! ( vceq_u32, uint32x2_t) ;
803
803
arm_simd_ceq ! ( vceqq_u32, uint32x4_t) ;
804
804
805
-
806
805
// arm_simd_ceq!(vceq_f32, float32x2_t); // we have a different return type
807
806
#[ inline]
808
807
#[ target_feature( enable = "neon" ) ]
@@ -826,16 +825,6 @@ pub unsafe fn vceqq_f32(a: float32x4_t, b: float32x4_t) -> uint32x4_t {
826
825
arm_simd_ceq ! ( vceq_p8, poly8x8_t) ;
827
826
arm_simd_ceq ! ( vceqq_p8, poly8x16_t) ;
828
827
829
- // TODO:
830
- // uint64x1_t vceq_s64 (int64x1_t a, int64x1_t b)Compare bitwise equal
831
- // uint64x2_t vceqq_s64 (int64x2_t a, int64x2_t b)Compare bitwise equal
832
- // uint64x1_t vceq_u64 (uint64x1_t a, uint64x1_t b)Compare bitwise equal
833
- // uint64x2_t vceqq_u64 (uint64x2_t a, uint64x2_t b)Compare bitwise equal
834
- // uint64x1_t vceq_p64 (poly64x1_t a, poly64x1_t b)Compare bitwise equal
835
- // uint64x2_t vceqq_p64 (poly64x2_t a, poly64x2_t b)Compare bitwise equal
836
- // ui nt64x1_t vceq_f64 (float64x1_t a, float64x1_t b)Floating-point compare equal
837
- // uint64x2_t vceqq_f64 (float64x2_t a, float64x2_t b)Floating-point compare equal
838
-
839
828
/// Folding minimum of adjacent pairs
840
829
#[ inline]
841
830
#[ target_feature( enable = "neon" ) ]
@@ -1842,7 +1831,7 @@ mod tests {
1842
1831
assert_eq ! ( r, a) ;
1843
1832
}
1844
1833
1845
- #[ simd_test( enable = "neon" ) ]
1834
+ #[ simd_test( enable = "neon" ) ]
1846
1835
unsafe fn test_veor_s8 ( ) {
1847
1836
let a = i8x8:: new ( 0x00 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 ) ;
1848
1837
let b = i8x8:: new ( 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 , 0x00 ) ;
@@ -1970,6 +1959,122 @@ mod tests {
1970
1959
assert_eq ! ( r, b) ;
1971
1960
}
1972
1961
1962
+ #[ simd_test( enable = "neon" ) ]
1963
+ unsafe fn test_vceq_s8 ( ) {
1964
+ let a = i8x8:: new ( 0x00 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 ) ;
1965
+ let b = i8x8:: new ( -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ) ;
1966
+ let r: i8x8 = transmute ( vceq_s8 ( transmute ( a) , transmute ( a) ) ) ;
1967
+ assert_eq ! ( r, b) ;
1968
+ }
1969
+
1970
+ #[ simd_test( enable = "neon" ) ]
1971
+ unsafe fn test_vceqq_s8 ( ) {
1972
+ let a = i8x16:: new ( 0x00 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 , 0x09 , 0x0A , 0x0B , 0x0C , 0x0D , 0x0E , 0x0F ) ;
1973
+ let b = i8x16:: new ( -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ) ;
1974
+ let r: i8x16 = transmute ( vceqq_s8 ( transmute ( a) , transmute ( a) ) ) ;
1975
+ assert_eq ! ( r, b) ;
1976
+ }
1977
+
1978
+ #[ simd_test( enable = "neon" ) ]
1979
+ unsafe fn test_vceq_s16 ( ) {
1980
+ let a = i16x4:: new ( 0x0001 , 0x0203 , 0x0405 , 0x0607 ) ;
1981
+ let b = i16x4:: new ( -1 , -1 , -1 , -1 ) ;
1982
+ let r: i16x4 = transmute ( vceq_s16 ( transmute ( a) , transmute ( a) ) ) ;
1983
+ assert_eq ! ( r, b) ;
1984
+ }
1985
+
1986
+ #[ simd_test( enable = "neon" ) ]
1987
+ unsafe fn test_vceqq_s16 ( ) {
1988
+ let a = i16x8:: new ( 0x0001 , 0x0203 , 0x0405 , 0x0607 , 0x0809 , 0x0A0B , 0x0C0D , 0x0E0F ) ;
1989
+ let b = i16x8:: new ( -1 , -1 , -1 , -1 , -1 , -1 , -1 , -1 ) ;
1990
+ let r: i16x8 = transmute ( vceqq_s16 ( transmute ( a) , transmute ( a) ) ) ;
1991
+ assert_eq ! ( r, b) ;
1992
+ }
1993
+
1994
+ #[ simd_test( enable = "neon" ) ]
1995
+ unsafe fn test_vceq_s32 ( ) {
1996
+ let a = i32x2:: new ( 0x00010203 , 0x04050607 ) ;
1997
+ let b = i32x2:: new ( -1 , -1 ) ;
1998
+ let r: i32x2 = transmute ( vceq_s32 ( transmute ( a) , transmute ( a) ) ) ;
1999
+ assert_eq ! ( r, b) ;
2000
+ }
2001
+
2002
+ #[ simd_test( enable = "neon" ) ]
2003
+ unsafe fn test_vceqq_s32 ( ) {
2004
+ let a = i32x4:: new ( 0x00010203 , 0x04050607 , 0x08090A0B , 0x0C0D0E0F ) ;
2005
+ let b = i32x4:: new ( -1 , -1 , -1 , -1 ) ;
2006
+ let r: i32x4 = transmute ( vceqq_s32 ( transmute ( a) , transmute ( a) ) ) ;
2007
+ assert_eq ! ( r, b) ;
2008
+ }
2009
+
2010
+
2011
+
2012
+ #[ simd_test( enable = "neon" ) ]
2013
+ unsafe fn test_vceq_u8 ( ) {
2014
+ let a = u8x8:: new ( 0x00 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 ) ;
2015
+ let b = u8x8:: new ( 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ) ;
2016
+ let r: u8x8 = transmute ( vceq_u8 ( transmute ( a) , transmute ( a) ) ) ;
2017
+ assert_eq ! ( r, b) ;
2018
+ }
2019
+
2020
+ #[ simd_test( enable = "neon" ) ]
2021
+ unsafe fn test_vceqq_u8 ( ) {
2022
+ let a = u8x16:: new ( 0x00 , 0x01 , 0x02 , 0x03 , 0x04 , 0x05 , 0x06 , 0x07 , 0x08 , 0x09 , 0x0A , 0x0B , 0x0C , 0x0D , 0x0E , 0x0F ) ;
2023
+ let b = u8x16:: new ( 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF , 0xFF ) ;
2024
+ let r: u8x16 = transmute ( vceqq_u8 ( transmute ( a) , transmute ( a) ) ) ;
2025
+ assert_eq ! ( r, b) ;
2026
+ }
2027
+
2028
+ #[ simd_test( enable = "neon" ) ]
2029
+ unsafe fn test_vceq_u16 ( ) {
2030
+ let a = u16x4:: new ( 0x0001 , 0x0203 , 0x0405 , 0x0607 ) ;
2031
+ let b = u16x4:: new ( 0xFFFF , 0xFFFF , 0xFFFF , 0xFFFF ) ;
2032
+ let r: u16x4 = transmute ( vceq_u16 ( transmute ( a) , transmute ( a) ) ) ;
2033
+ assert_eq ! ( r, b) ;
2034
+ }
2035
+
2036
+ #[ simd_test( enable = "neon" ) ]
2037
+ unsafe fn test_vceqq_u16 ( ) {
2038
+ let a = u16x8:: new ( 0x0001 , 0x0203 , 0x0405 , 0x0607 , 0x0809 , 0x0A0B , 0x0C0D , 0x0E0F ) ;
2039
+ let b = u16x8:: new ( 0xFFFF , 0xFFFF , 0xFFFF , 0xFFFF , 0xFFFF , 0xFFFF , 0xFFFF , 0xFFFF ) ;
2040
+ let r: u16x8 = transmute ( vceqq_u16 ( transmute ( a) , transmute ( a) ) ) ;
2041
+ assert_eq ! ( r, b) ;
2042
+ }
2043
+
2044
+ #[ simd_test( enable = "neon" ) ]
2045
+ unsafe fn test_vceq_u32 ( ) {
2046
+ let a = u32x2:: new ( 0x00010203 , 0x04050607 ) ;
2047
+ let b = u32x2:: new ( 0xFFFFFFFF , 0xFFFFFFFF ) ;
2048
+ let r: u32x2 = transmute ( vceq_u32 ( transmute ( a) , transmute ( a) ) ) ;
2049
+ assert_eq ! ( r, b) ;
2050
+ }
2051
+
2052
+ #[ simd_test( enable = "neon" ) ]
2053
+ unsafe fn test_vceqq_u32 ( ) {
2054
+ let a = u32x4:: new ( 0x00010203 , 0x04050607 , 0x08090A0B , 0x0C0D0E0F ) ;
2055
+ let b = u32x4:: new ( 0xFFFFFFFF , 0xFFFFFFFF , 0xFFFFFFFF , 0xFFFFFFFF ) ;
2056
+ let r: u32x4 = transmute ( vceqq_u32 ( transmute ( a) , transmute ( a) ) ) ;
2057
+ assert_eq ! ( r, b) ;
2058
+ }
2059
+
2060
+
2061
+ #[ simd_test( enable = "neon" ) ]
2062
+ unsafe fn test_vceq_f32 ( ) {
2063
+ let a = f32x2:: new ( 1.2 , 2.3 ) ;
2064
+ let b = u32x2:: new ( 0xFFFFFFFF , 0xFFFFFFFF ) ;
2065
+ let r: u32x2 = transmute ( vceq_f32 ( transmute ( a) , transmute ( a) ) ) ;
2066
+ assert_eq ! ( r, b) ;
2067
+ }
2068
+
2069
+ #[ simd_test( enable = "neon" ) ]
2070
+ unsafe fn test_vceqq_f32 ( ) {
2071
+ let a = f32x4:: new ( 1.2 , 3.4 , 5.6 , 7.8 ) ;
2072
+ let b = u32x4:: new ( 0xFFFFFFFF , 0xFFFFFFFF , 0xFFFFFFFF , 0xFFFFFFFF ) ;
2073
+ let r: u32x4 = transmute ( vceqq_f32 ( transmute ( a) , transmute ( a) ) ) ;
2074
+ assert_eq ! ( r, b) ;
2075
+ }
2076
+
2077
+
1973
2078
#[ simd_test( enable = "neon" ) ]
1974
2079
unsafe fn test_vmovn_s16 ( ) {
1975
2080
let a = i16x8:: new ( 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 ) ;
0 commit comments