Skip to content

Commit c8aa9cd

Browse files
folkertdevAmanieu
authored andcommitted
basic infra for s390x vector intrinsics
1 parent 225e1ec commit c8aa9cd

File tree

6 files changed

+46
-0
lines changed

6 files changed

+46
-0
lines changed

Diff for: ci/run.sh

+4
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ case ${TARGET} in
124124
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+msa"
125125
cargo_test "${PROFILE}"
126126
;;
127+
s390x*)
128+
export RUSTFLAGS="${RUSTFLAGS} -C target-feature=+vector"
129+
cargo_test "${PROFILE}"
130+
;;
127131
powerpc64*)
128132
# We don't build the ppc 32-bit targets with these - these targets
129133
# are mostly unsupported for now.

Diff for: crates/core_arch/src/lib.rs

+2
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
avx512_target_feature,
2626
mips_target_feature,
2727
powerpc_target_feature,
28+
s390x_target_feature,
2829
loongarch_target_feature,
2930
wasm_target_feature,
3031
abi_unadjusted,
@@ -69,6 +70,7 @@
6970
feature(
7071
stdarch_arm_feature_detection,
7172
stdarch_powerpc_feature_detection,
73+
stdarch_s390x_feature_detection,
7274
stdarch_loongarch_feature_detection
7375
)
7476
)]

Diff for: crates/core_arch/src/mod.rs

+14
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,16 @@ pub mod arch {
278278
pub mod loongarch64 {
279279
pub use crate::core_arch::loongarch64::*;
280280
}
281+
282+
/// Platform-specific intrinsics for the `s390x` platform.
283+
///
284+
/// See the [module documentation](../index.html) for more details.
285+
#[cfg(any(target_arch = "s390x", doc))]
286+
#[doc(cfg(target_arch = "s390x"))]
287+
#[unstable(feature = "stdarch_s390x", issue = "1")]
288+
pub mod s390x {
289+
pub use crate::core_arch::s390x::*;
290+
}
281291
}
282292

283293
#[cfg(any(target_arch = "x86", target_arch = "x86_64", doc))]
@@ -325,3 +335,7 @@ mod nvptx;
325335
#[cfg(any(target_arch = "loongarch64", doc))]
326336
#[doc(cfg(target_arch = "loongarch64"))]
327337
mod loongarch64;
338+
339+
#[cfg(any(target_arch = "s390x", doc))]
340+
#[doc(cfg(target_arch = "s390x"))]
341+
mod s390x;

Diff for: crates/core_arch/src/s390x/mod.rs

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

Diff for: crates/core_arch/src/s390x/vector.rs

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#![allow(non_camel_case_types)]
2+
#![allow(unused_imports)]
3+
4+
use crate::{intrinsics::simd::*, mem::transmute};
5+
6+
#[cfg(test)]
7+
use stdarch_test::assert_instr;
8+
9+
#[cfg(test)]
10+
mod tests {
11+
use super::*;
12+
13+
use std::mem::transmute;
14+
15+
use crate::core_arch::simd::*;
16+
use stdarch_test::simd_test;
17+
18+
#[simd_test(enable = "vector")]
19+
unsafe fn dummy() {}
20+
}

Diff for: crates/simd-test-macro/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ pub fn simd_test(
7979
"is_mips64_feature_detected"
8080
}
8181
"loongarch64" => "is_loongarch_feature_detected",
82+
"s390x" => "is_s390x_feature_detected",
8283
t => panic!("unknown target: {t}"),
8384
};
8485
let macro_test = Ident::new(macro_test, Span::call_site());

0 commit comments

Comments
 (0)