Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

S390x float rounding #1712

Merged
merged 5 commits into from
Feb 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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-enhancements-1"
cargo_test "${PROFILE}"
;;
powerpc64*)
# We don't build the ppc 32-bit targets with these - these targets
# are mostly unsupported for now.
Expand Down
23 changes: 23 additions & 0 deletions crates/core_arch/src/s390x/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@
#![allow(unused_imports)] // FIXME remove when more tests are added

macro_rules! test_impl {
($fun:ident ($($v:ident : $ty:ty),*) -> $r:ty [$call:ident, _]) => {
#[inline]
#[target_feature(enable = "vector")]
pub unsafe fn $fun ($($v : $ty),*) -> $r {
$call ($($v),*)
}
};
($fun:ident +($($v:ident : $ty:ty),*) -> $r:ty [$call:ident, $instr:ident]) => {
#[inline]
#[target_feature(enable = "vector")]
Expand All @@ -10,6 +17,22 @@ macro_rules! test_impl {
transmute($call ($($v),*))
}
};
($fun:ident +($($v:ident : $ty:ty),*) -> $r:ty [$call:ident, $tf:literal $instr:ident]) => {
#[inline]
#[target_feature(enable = "vector")]
#[cfg_attr(all(test, target_feature = $tf), assert_instr($instr))]
pub unsafe fn $fun ($($v : $ty),*) -> $r {
transmute($call ($($v),*))
}
};
($fun:ident ($($v:ident : $ty:ty),*) -> $r:ty [$call:ident, $tf:literal $instr:ident]) => {
#[inline]
#[target_feature(enable = "vector")]
#[cfg_attr(all(test, target_feature = $tf), assert_instr($instr))]
pub unsafe fn $fun ($($v : $ty),*) -> $r {
$call ($($v),*)
}
};
($fun:ident ($($v:ident : $ty:ty),*) -> $r:ty [$call:ident, $instr:ident]) => {
#[inline]
#[target_feature(enable = "vector")]
Expand Down
Loading