From 3660dfff5a10bd8601f397f77189f42380f44243 Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Thu, 6 Mar 2025 16:39:16 +0100 Subject: [PATCH] add `vec_cmprg_cc` and friends --- .../crates/core_arch/src/s390x/vector.rs | 40 +++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/library/stdarch/crates/core_arch/src/s390x/vector.rs b/library/stdarch/crates/core_arch/src/s390x/vector.rs index e4de4d107d02..dcd1aa694773 100644 --- a/library/stdarch/crates/core_arch/src/s390x/vector.rs +++ b/library/stdarch/crates/core_arch/src/s390x/vector.rs @@ -4752,6 +4752,46 @@ pub unsafe fn vec_cmpnrg_idx(a: T, b: T, c: T) -> a.vstrc::<{ FindImm::NeIdx as u32 }>(b, c) } +/// Vector Compare Ranges with Condition Code +#[inline] +#[target_feature(enable = "vector")] +#[unstable(feature = "stdarch_s390x", issue = "135681")] +pub unsafe fn vec_cmprg_cc(a: T, b: T, c: T, d: *mut i32) -> T::Result { + let (x,y) = a.vstrcs::<{ FindImm::Eq as u32 }>(b, c); + d.write(y); + x +} + +/// Vector Compare Not in Ranges with Condition Code +#[inline] +#[target_feature(enable = "vector")] +#[unstable(feature = "stdarch_s390x", issue = "135681")] +pub unsafe fn vec_cmpnrg_cc(a: T, b: T, c: T, d: *mut i32) -> T::Result { + let (x,y) = a.vstrcs::<{ FindImm::Ne as u32 }>(b, c); + d.write(y); + x +} + +/// Vector Compare Ranges Index with Condition Code +#[inline] +#[target_feature(enable = "vector")] +#[unstable(feature = "stdarch_s390x", issue = "135681")] +pub unsafe fn vec_cmprg_idx_cc(a: T, b: T, c: T, d: *mut i32) -> T::Result { + let (x,y) = a.vstrcs::<{ FindImm::EqIdx as u32 }>(b, c); + d.write(y); + x +} + +/// Vector Compare Not in Ranges Index with Condition Code +#[inline] +#[target_feature(enable = "vector")] +#[unstable(feature = "stdarch_s390x", issue = "135681")] +pub unsafe fn vec_cmpnrg_idx_cc(a: T, b: T, c: T, d: *mut i32) -> T::Result { + let (x,y) = a.vstrcs::<{ FindImm::NeIdx as u32 }>(b, c); + d.write(y); + x +} + #[cfg(test)] mod tests { use super::*;