Skip to content
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
8 changes: 8 additions & 0 deletions compiler/rustc_target/src/target_features.rs
Original file line number Diff line number Diff line change
Expand Up @@ -849,6 +849,7 @@ const IBMZ_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
("miscellaneous-extensions-3", Unstable(sym::s390x_target_feature), &[]),
("miscellaneous-extensions-4", Unstable(sym::s390x_target_feature), &[]),
("nnp-assist", Unstable(sym::s390x_target_feature), &["vector"]),
("soft-float", Forbidden { reason: "currently unsupported ABI-configuration feature" }, &[]),
("transactional-execution", Unstable(sym::s390x_target_feature), &[]),
("vector", Unstable(sym::s390x_target_feature), &[]),
("vector-enhancements-1", Unstable(sym::s390x_target_feature), &["vector"]),
Expand Down Expand Up @@ -1177,6 +1178,13 @@ impl Target {
_ => unreachable!(),
}
}
"s390x" => {
// We don't currently support a softfloat target on this architecture.
// As usual, we have to reject swapping the `soft-float` target feature.
// The "vector" target feature does not affect the ABI for floats
// because the vector and float registers overlap.
FeatureConstraints { required: &[], incompatible: &["soft-float"] }
}
_ => NOTHING,
}
}
Expand Down
1 change: 1 addition & 0 deletions tests/ui/abi/simd-abi-checks-s390x.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// FIXME: +soft-float itself doesn't set -vector
//@[z13_soft_float] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector,+soft-float
//@[z13_soft_float] needs-llvm-components: systemz
//[z13_soft_float]~? WARN must be disabled to ensure that the ABI of the current target can be implemented correctly
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...we really should get a more consistent annotation syntax here...


#![feature(no_core, repr_simd, s390x_target_feature)]
#![no_core]
Expand Down
20 changes: 10 additions & 10 deletions tests/ui/abi/simd-abi-checks-s390x.z10.stderr
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
error: this function definition uses SIMD vector type `i8x8` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:38:1
--> $DIR/simd-abi-checks-s390x.rs:39:1
|
LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `i8x16` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:43:1
--> $DIR/simd-abi-checks-s390x.rs:44:1
|
LL | extern "C" fn vector_ret(x: &i8x16) -> i8x16 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `TransparentWrapper<i8x8>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:89:1
--> $DIR/simd-abi-checks-s390x.rs:90:1
|
LL | / extern "C" fn vector_transparent_wrapper_ret_small(
LL | | x: &TransparentWrapper<i8x8>,
Expand All @@ -25,7 +25,7 @@ LL | | ) -> TransparentWrapper<i8x8> {
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `TransparentWrapper<i8x16>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:96:1
--> $DIR/simd-abi-checks-s390x.rs:97:1
|
LL | / extern "C" fn vector_transparent_wrapper_ret(
LL | | x: &TransparentWrapper<i8x16>,
Expand All @@ -35,47 +35,47 @@ LL | | ) -> TransparentWrapper<i8x16> {
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `i8x8` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:111:1
--> $DIR/simd-abi-checks-s390x.rs:112:1
|
LL | extern "C" fn vector_arg_small(x: i8x8) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `i8x16` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:116:1
--> $DIR/simd-abi-checks-s390x.rs:117:1
|
LL | extern "C" fn vector_arg(x: i8x16) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `Wrapper<i8x8>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:127:1
--> $DIR/simd-abi-checks-s390x.rs:128:1
|
LL | extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `Wrapper<i8x16>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:132:1
--> $DIR/simd-abi-checks-s390x.rs:133:1
|
LL | extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `TransparentWrapper<i8x8>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:143:1
--> $DIR/simd-abi-checks-s390x.rs:144:1
|
LL | extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `TransparentWrapper<i8x16>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:148:1
--> $DIR/simd-abi-checks-s390x.rs:149:1
|
LL | extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
Expand Down
20 changes: 10 additions & 10 deletions tests/ui/abi/simd-abi-checks-s390x.z13_no_vector.stderr
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
error: this function definition uses SIMD vector type `i8x8` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:38:1
--> $DIR/simd-abi-checks-s390x.rs:39:1
|
LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `i8x16` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:43:1
--> $DIR/simd-abi-checks-s390x.rs:44:1
|
LL | extern "C" fn vector_ret(x: &i8x16) -> i8x16 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `TransparentWrapper<i8x8>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:89:1
--> $DIR/simd-abi-checks-s390x.rs:90:1
|
LL | / extern "C" fn vector_transparent_wrapper_ret_small(
LL | | x: &TransparentWrapper<i8x8>,
Expand All @@ -25,7 +25,7 @@ LL | | ) -> TransparentWrapper<i8x8> {
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `TransparentWrapper<i8x16>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:96:1
--> $DIR/simd-abi-checks-s390x.rs:97:1
|
LL | / extern "C" fn vector_transparent_wrapper_ret(
LL | | x: &TransparentWrapper<i8x16>,
Expand All @@ -35,47 +35,47 @@ LL | | ) -> TransparentWrapper<i8x16> {
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `i8x8` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:111:1
--> $DIR/simd-abi-checks-s390x.rs:112:1
|
LL | extern "C" fn vector_arg_small(x: i8x8) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `i8x16` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:116:1
--> $DIR/simd-abi-checks-s390x.rs:117:1
|
LL | extern "C" fn vector_arg(x: i8x16) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `Wrapper<i8x8>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:127:1
--> $DIR/simd-abi-checks-s390x.rs:128:1
|
LL | extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `Wrapper<i8x16>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:132:1
--> $DIR/simd-abi-checks-s390x.rs:133:1
|
LL | extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `TransparentWrapper<i8x8>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:143:1
--> $DIR/simd-abi-checks-s390x.rs:144:1
|
LL | extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `TransparentWrapper<i8x16>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:148:1
--> $DIR/simd-abi-checks-s390x.rs:149:1
|
LL | extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
Expand Down
27 changes: 16 additions & 11 deletions tests/ui/abi/simd-abi-checks-s390x.z13_soft_float.stderr
Original file line number Diff line number Diff line change
@@ -1,21 +1,26 @@
warning: target feature `soft-float` must be disabled to ensure that the ABI of the current target can be implemented correctly
|
= note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
= note: for more information, see issue #116344 <https://github.com/rust-lang/rust/issues/116344>

error: this function definition uses SIMD vector type `i8x8` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:38:1
--> $DIR/simd-abi-checks-s390x.rs:39:1
|
LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `i8x16` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:43:1
--> $DIR/simd-abi-checks-s390x.rs:44:1
|
LL | extern "C" fn vector_ret(x: &i8x16) -> i8x16 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `TransparentWrapper<i8x8>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:89:1
--> $DIR/simd-abi-checks-s390x.rs:90:1
|
LL | / extern "C" fn vector_transparent_wrapper_ret_small(
LL | | x: &TransparentWrapper<i8x8>,
Expand All @@ -25,7 +30,7 @@ LL | | ) -> TransparentWrapper<i8x8> {
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `TransparentWrapper<i8x16>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:96:1
--> $DIR/simd-abi-checks-s390x.rs:97:1
|
LL | / extern "C" fn vector_transparent_wrapper_ret(
LL | | x: &TransparentWrapper<i8x16>,
Expand All @@ -35,52 +40,52 @@ LL | | ) -> TransparentWrapper<i8x16> {
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `i8x8` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:111:1
--> $DIR/simd-abi-checks-s390x.rs:112:1
|
LL | extern "C" fn vector_arg_small(x: i8x8) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `i8x16` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:116:1
--> $DIR/simd-abi-checks-s390x.rs:117:1
|
LL | extern "C" fn vector_arg(x: i8x16) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `Wrapper<i8x8>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:127:1
--> $DIR/simd-abi-checks-s390x.rs:128:1
|
LL | extern "C" fn vector_wrapper_arg_small(x: Wrapper<i8x8>) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `Wrapper<i8x16>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:132:1
--> $DIR/simd-abi-checks-s390x.rs:133:1
|
LL | extern "C" fn vector_wrapper_arg(x: Wrapper<i8x16>) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `TransparentWrapper<i8x8>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:143:1
--> $DIR/simd-abi-checks-s390x.rs:144:1
|
LL | extern "C" fn vector_transparent_wrapper_arg_small(x: TransparentWrapper<i8x8>) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: this function definition uses SIMD vector type `TransparentWrapper<i8x16>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
--> $DIR/simd-abi-checks-s390x.rs:148:1
--> $DIR/simd-abi-checks-s390x.rs:149:1
|
LL | extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 {
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
|
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)

error: aborting due to 10 previous errors
error: aborting due to 10 previous errors; 1 warning emitted

Loading