Skip to content

Commit acf8996

Browse files
folkertdevAmanieu
authored andcommitted
add vec_cmprg_cc and friends
1 parent 1eac180 commit acf8996

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed

crates/core_arch/src/s390x/vector.rs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4752,6 +4752,46 @@ pub unsafe fn vec_cmpnrg_idx<T: sealed::VectorCompareRange>(a: T, b: T, c: T) ->
47524752
a.vstrc::<{ FindImm::NeIdx as u32 }>(b, c)
47534753
}
47544754

4755+
/// Vector Compare Ranges with Condition Code
4756+
#[inline]
4757+
#[target_feature(enable = "vector")]
4758+
#[unstable(feature = "stdarch_s390x", issue = "135681")]
4759+
pub unsafe fn vec_cmprg_cc<T: sealed::VectorCompareRange>(a: T, b: T, c: T, d: *mut i32) -> T::Result {
4760+
let (x,y) = a.vstrcs::<{ FindImm::Eq as u32 }>(b, c);
4761+
d.write(y);
4762+
x
4763+
}
4764+
4765+
/// Vector Compare Not in Ranges with Condition Code
4766+
#[inline]
4767+
#[target_feature(enable = "vector")]
4768+
#[unstable(feature = "stdarch_s390x", issue = "135681")]
4769+
pub unsafe fn vec_cmpnrg_cc<T: sealed::VectorCompareRange>(a: T, b: T, c: T, d: *mut i32) -> T::Result {
4770+
let (x,y) = a.vstrcs::<{ FindImm::Ne as u32 }>(b, c);
4771+
d.write(y);
4772+
x
4773+
}
4774+
4775+
/// Vector Compare Ranges Index with Condition Code
4776+
#[inline]
4777+
#[target_feature(enable = "vector")]
4778+
#[unstable(feature = "stdarch_s390x", issue = "135681")]
4779+
pub unsafe fn vec_cmprg_idx_cc<T: sealed::VectorCompareRange>(a: T, b: T, c: T, d: *mut i32) -> T::Result {
4780+
let (x,y) = a.vstrcs::<{ FindImm::EqIdx as u32 }>(b, c);
4781+
d.write(y);
4782+
x
4783+
}
4784+
4785+
/// Vector Compare Not in Ranges Index with Condition Code
4786+
#[inline]
4787+
#[target_feature(enable = "vector")]
4788+
#[unstable(feature = "stdarch_s390x", issue = "135681")]
4789+
pub unsafe fn vec_cmpnrg_idx_cc<T: sealed::VectorCompareRange>(a: T, b: T, c: T, d: *mut i32) -> T::Result {
4790+
let (x,y) = a.vstrcs::<{ FindImm::NeIdx as u32 }>(b, c);
4791+
d.write(y);
4792+
x
4793+
}
4794+
47554795
#[cfg(test)]
47564796
mod tests {
47574797
use super::*;

0 commit comments

Comments
 (0)