@@ -4720,13 +4720,22 @@ pub unsafe fn vec_srdb<T: sealed::VectorSrdb, const C: u32>(a: T, b: T) -> T {
4720
4720
a. vec_srdb :: < C > ( b)
4721
4721
}
4722
4722
4723
+ /// Vector Compare Ranges
4723
4724
#[ inline]
4724
4725
#[ target_feature( enable = "vector" ) ]
4725
4726
#[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
4726
4727
pub unsafe fn vec_cmprg < T : sealed:: VectorCompareRange > ( a : T , b : T , c : T ) -> T :: Result {
4727
4728
a. vstrc :: < { FindImm :: Eq as u32 } > ( b, c)
4728
4729
}
4729
4730
4731
+ /// Vector Compare Not in Ranges
4732
+ #[ inline]
4733
+ #[ target_feature( enable = "vector" ) ]
4734
+ #[ unstable( feature = "stdarch_s390x" , issue = "135681" ) ]
4735
+ pub unsafe fn vec_cmpnrg < T : sealed:: VectorCompareRange > ( a : T , b : T , c : T ) -> T :: Result {
4736
+ a. vstrc :: < { FindImm :: Ne as u32 } > ( b, c)
4737
+ }
4738
+
4730
4739
#[ cfg( test) ]
4731
4740
mod tests {
4732
4741
use super :: * ;
@@ -6005,12 +6014,12 @@ mod tests {
6005
6014
}
6006
6015
}
6007
6016
6017
+ const GT : u32 = 0x20000000 ;
6018
+ const LT : u32 = 0x40000000 ;
6019
+ const EQ : u32 = 0x80000000 ;
6020
+
6008
6021
#[ simd_test( enable = "vector" ) ]
6009
6022
fn test_vec_cmprg ( ) {
6010
- const GT : u32 = 0x20000000 ;
6011
- const LT : u32 = 0x40000000 ;
6012
- const EQ : u32 = 0x80000000 ;
6013
-
6014
6023
let a = vector_unsigned_int ( [ 11 , 22 , 33 , 44 ] ) ;
6015
6024
let b = vector_unsigned_int ( [ 10 , 20 , 30 , 40 ] ) ;
6016
6025
@@ -6029,4 +6038,25 @@ mod tests {
6029
6038
let d = unsafe { vec_cmprg ( a, b, c) } ;
6030
6039
assert_eq ! ( d. as_array( ) , & [ !0 , 0 , 0 , !0 ] ) ;
6031
6040
}
6041
+
6042
+ #[ simd_test( enable = "vector" ) ]
6043
+ fn test_vec_cmpnrg ( ) {
6044
+ let a = vector_unsigned_int ( [ 11 , 22 , 33 , 44 ] ) ;
6045
+ let b = vector_unsigned_int ( [ 10 , 20 , 30 , 40 ] ) ;
6046
+
6047
+ let c = vector_unsigned_int ( [ GT , LT , GT , LT ] ) ;
6048
+ let d = unsafe { vec_cmpnrg ( a, b, c) } ;
6049
+ assert_eq ! ( d. as_array( ) , & [ 0 , !0 , 0 , !0 ] ) ;
6050
+
6051
+ let c = vector_unsigned_int ( [ GT , LT , 0 , 0 ] ) ;
6052
+ let d = unsafe { vec_cmpnrg ( a, b, c) } ;
6053
+ assert_eq ! ( d. as_array( ) , & [ 0 , !0 , !0 , !0 ] ) ;
6054
+
6055
+ let a = vector_unsigned_int ( [ 11 , 22 , 33 , 30 ] ) ;
6056
+ let b = vector_unsigned_int ( [ 10 , 20 , 30 , 30 ] ) ;
6057
+
6058
+ let c = vector_unsigned_int ( [ GT , LT , EQ , EQ ] ) ;
6059
+ let d = unsafe { vec_cmpnrg ( a, b, c) } ;
6060
+ assert_eq ! ( d. as_array( ) , & [ 0 , !0 , !0 , 0 ] ) ;
6061
+ }
6032
6062
}
0 commit comments