basic infra for s390x vector intrinsics

This commit is contained in:
Folkert de Vries 2025-01-18 13:44:24 +01:00 committed by Amanieu d'Antras
parent b5babcfac2
commit 48bbd53d19
6 changed files with 46 additions and 0 deletions

View file

@ -124,6 +124,10 @@ case ${TARGET} in
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+msa"
cargo_test "${PROFILE}"
;;
s390x*)
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+vector"
cargo_test "${PROFILE}"
;;
powerpc64*)
# We don't build the ppc 32-bit targets with these - these targets
# are mostly unsupported for now.

View file

@ -25,6 +25,7 @@
avx512_target_feature,
mips_target_feature,
powerpc_target_feature,
s390x_target_feature,
loongarch_target_feature,
wasm_target_feature,
abi_unadjusted,
@ -69,6 +70,7 @@
feature(
stdarch_arm_feature_detection,
stdarch_powerpc_feature_detection,
stdarch_s390x_feature_detection,
stdarch_loongarch_feature_detection
)
)]

View file

@ -278,6 +278,16 @@ pub mod arch {
pub mod loongarch64 {
pub use crate::core_arch::loongarch64::*;
}
/// Platform-specific intrinsics for the `s390x` platform.
///
/// See the [module documentation](../index.html) for more details.
#[cfg(any(target_arch = "s390x", doc))]
#[doc(cfg(target_arch = "s390x"))]
#[unstable(feature = "stdarch_s390x", issue = "1")]
pub mod s390x {
pub use crate::core_arch::s390x::*;
}
}
#[cfg(any(target_arch = "x86", target_arch = "x86_64", doc))]
@ -325,3 +335,7 @@ mod nvptx;
#[cfg(any(target_arch = "loongarch64", doc))]
#[doc(cfg(target_arch = "loongarch64"))]
mod loongarch64;
#[cfg(any(target_arch = "s390x", doc))]
#[doc(cfg(target_arch = "s390x"))]
mod s390x;

View file

@ -0,0 +1,5 @@
//! `SystemZ` intrinsics
mod vector;
#[unstable(feature = "stdarch_s390x", issue = "130869")]
pub use self::vector::*;

View file

@ -0,0 +1,20 @@
#![allow(non_camel_case_types)]
#![allow(unused_imports)]
use crate::{intrinsics::simd::*, mem::transmute};
#[cfg(test)]
use stdarch_test::assert_instr;
#[cfg(test)]
mod tests {
use super::*;
use std::mem::transmute;
use crate::core_arch::simd::*;
use stdarch_test::simd_test;
#[simd_test(enable = "vector")]
unsafe fn dummy() {}
}

View file

@ -79,6 +79,7 @@ pub fn simd_test(
"is_mips64_feature_detected"
}
"loongarch64" => "is_loongarch_feature_detected",
"s390x" => "is_s390x_feature_detected",
t => panic!("unknown target: {t}"),
};
let macro_test = Ident::new(macro_test, Span::call_site());