Skip to content

Commit 6f4bed9

Browse files
folkertdevAmanieu
authored andcommitted
add vec_cmprg_or_0_idx_cc and vec_cmpnrg_or_0_idx_cc
1 parent 1a66de6 commit 6f4bed9

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

crates/core_arch/src/s390x/vector.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4848,6 +4848,36 @@ pub unsafe fn vec_cmpnrg_or_0_idx<T: sealed::VectorCompareRange>(a: T, b: T, c:
48484848
a.vstrcz::<{ FindImm::NeIdx as u32 }>(b, c)
48494849
}
48504850

4851+
/// Vector Compare Ranges or Zero Index with Condition Code
4852+
#[inline]
4853+
#[target_feature(enable = "vector")]
4854+
#[unstable(feature = "stdarch_s390x", issue = "135681")]
4855+
pub unsafe fn vec_cmprg_or_0_idx_cc<T: sealed::VectorCompareRange>(
4856+
a: T,
4857+
b: T,
4858+
c: T,
4859+
d: *mut i32,
4860+
) -> T::Result {
4861+
let (x, y) = a.vstrczs::<{ FindImm::EqIdx as u32 }>(b, c);
4862+
d.write(y);
4863+
x
4864+
}
4865+
4866+
/// Vector Compare Not in Ranges or Zero Index with Condition Code
4867+
#[inline]
4868+
#[target_feature(enable = "vector")]
4869+
#[unstable(feature = "stdarch_s390x", issue = "135681")]
4870+
pub unsafe fn vec_cmpnrg_or_0_idx_cc<T: sealed::VectorCompareRange>(
4871+
a: T,
4872+
b: T,
4873+
c: T,
4874+
d: *mut i32,
4875+
) -> T::Result {
4876+
let (x, y) = a.vstrczs::<{ FindImm::NeIdx as u32 }>(b, c);
4877+
d.write(y);
4878+
x
4879+
}
4880+
48514881
#[cfg(test)]
48524882
mod tests {
48534883
use super::*;

0 commit comments

Comments
 (0)