From d218bd162420e8a97a63a10fd13591e4f1a53c00 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 6 Mar 2025 16:50:04 +0100 Subject: [PATCH] add `vec_cmprg_or_0_idx_cc` and `vec_cmpnrg_or_0_idx_cc` --- .../crates/core_arch/src/s390x/vector.rs | 30 +++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/library/stdarch/crates/core_arch/src/s390x/vector.rs b/library/stdarch/crates/core_arch/src/s390x/vector.rs index 54bfc98af530..a0d60e55d11e 100644 --- a/library/stdarch/crates/core_arch/src/s390x/vector.rs +++ b/library/stdarch/crates/core_arch/src/s390x/vector.rs @@ -4848,6 +4848,36 @@ pub unsafe fn vec_cmpnrg_or_0_idx(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( + 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( + 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::*;