add vec_cmprg_or_0_idx_cc and vec_cmpnrg_or_0_idx_cc

This commit is contained in:
Folkert de Vries 2025-03-06 16:50:04 +01:00 committed by Amanieu d'Antras
parent 790d77e4e6
commit d218bd1624

View file

@ -4848,6 +4848,36 @@ pub unsafe fn vec_cmpnrg_or_0_idx<T: sealed::VectorCompareRange>(a: T, b: T, c:
a.vstrcz::<{ FindImm::NeIdx as u32 }>(b, c)
}
/// Vector Compare Ranges or Zero Index with Condition Code
#[inline]
#[target_feature(enable = "vector")]
#[unstable(feature = "stdarch_s390x", issue = "135681")]
pub unsafe fn vec_cmprg_or_0_idx_cc<T: sealed::VectorCompareRange>(
a: T,
b: T,
c: T,
d: *mut i32,
) -> T::Result {
let (x, y) = a.vstrczs::<{ FindImm::EqIdx as u32 }>(b, c);
d.write(y);
x
}
/// Vector Compare Not in Ranges or Zero Index with Condition Code
#[inline]
#[target_feature(enable = "vector")]
#[unstable(feature = "stdarch_s390x", issue = "135681")]
pub unsafe fn vec_cmpnrg_or_0_idx_cc<T: sealed::VectorCompareRange>(
a: T,
b: T,
c: T,
d: *mut i32,
) -> T::Result {
let (x, y) = a.vstrczs::<{ FindImm::NeIdx as u32 }>(b, c);
d.write(y);
x
}
#[cfg(test)]
mod tests {
use super::*;