Skip to content

Commit 47579ad

Browse files
authored
Unrolled build for #146415
Rollup merge of #146415 - RalfJung:s390x-softfloat, r=workingjubilee s390x: mark soft-float target feature as incompatible This provides a more informative warning when someone manually sets `+soft-float` on s390x.
2 parents 5e33838 + 3b21783 commit 47579ad

File tree

5 files changed

+45
-31
lines changed

5 files changed

+45
-31
lines changed

compiler/rustc_target/src/target_features.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -849,6 +849,7 @@ const IBMZ_FEATURES: &[(&str, Stability, ImpliedFeatures)] = &[
849849
("miscellaneous-extensions-3", Unstable(sym::s390x_target_feature), &[]),
850850
("miscellaneous-extensions-4", Unstable(sym::s390x_target_feature), &[]),
851851
("nnp-assist", Unstable(sym::s390x_target_feature), &["vector"]),
852+
("soft-float", Forbidden { reason: "currently unsupported ABI-configuration feature" }, &[]),
852853
("transactional-execution", Unstable(sym::s390x_target_feature), &[]),
853854
("vector", Unstable(sym::s390x_target_feature), &[]),
854855
("vector-enhancements-1", Unstable(sym::s390x_target_feature), &["vector"]),
@@ -1177,6 +1178,13 @@ impl Target {
11771178
_ => unreachable!(),
11781179
}
11791180
}
1181+
"s390x" => {
1182+
// We don't currently support a softfloat target on this architecture.
1183+
// As usual, we have to reject swapping the `soft-float` target feature.
1184+
// The "vector" target feature does not affect the ABI for floats
1185+
// because the vector and float registers overlap.
1186+
FeatureConstraints { required: &[], incompatible: &["soft-float"] }
1187+
}
11801188
_ => NOTHING,
11811189
}
11821190
}

tests/ui/abi/simd-abi-checks-s390x.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
// FIXME: +soft-float itself doesn't set -vector
99
//@[z13_soft_float] compile-flags: --target s390x-unknown-linux-gnu -C target-cpu=z13 -C target-feature=-vector,+soft-float
1010
//@[z13_soft_float] needs-llvm-components: systemz
11+
//[z13_soft_float]~? WARN must be disabled to ensure that the ABI of the current target can be implemented correctly
1112

1213
#![feature(no_core, repr_simd, s390x_target_feature)]
1314
#![no_core]

tests/ui/abi/simd-abi-checks-s390x.z10.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
error: this function definition uses SIMD vector type `i8x8` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
2-
--> $DIR/simd-abi-checks-s390x.rs:38:1
2+
--> $DIR/simd-abi-checks-s390x.rs:39:1
33
|
44
LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
66
|
77
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
88

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

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

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

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

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

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

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

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

7777
error: this function definition uses SIMD vector type `TransparentWrapper<i8x16>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
78-
--> $DIR/simd-abi-checks-s390x.rs:148:1
78+
--> $DIR/simd-abi-checks-s390x.rs:149:1
7979
|
8080
LL | extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 {
8181
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here

tests/ui/abi/simd-abi-checks-s390x.z13_no_vector.stderr

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
error: this function definition uses SIMD vector type `i8x8` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
2-
--> $DIR/simd-abi-checks-s390x.rs:38:1
2+
--> $DIR/simd-abi-checks-s390x.rs:39:1
33
|
44
LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 {
55
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
66
|
77
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
88

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

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

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

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

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

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

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

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

7777
error: this function definition uses SIMD vector type `TransparentWrapper<i8x16>` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
78-
--> $DIR/simd-abi-checks-s390x.rs:148:1
78+
--> $DIR/simd-abi-checks-s390x.rs:149:1
7979
|
8080
LL | extern "C" fn vector_transparent_wrapper_arg(x: TransparentWrapper<i8x16>) -> i64 {
8181
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,26 @@
1+
warning: target feature `soft-float` must be disabled to ensure that the ABI of the current target can be implemented correctly
2+
|
3+
= note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
4+
= note: for more information, see issue #116344 <https://github.com/rust-lang/rust/issues/116344>
5+
16
error: this function definition uses SIMD vector type `i8x8` which (with the chosen ABI) requires the `vector` target feature, which is not enabled
2-
--> $DIR/simd-abi-checks-s390x.rs:38:1
7+
--> $DIR/simd-abi-checks-s390x.rs:39:1
38
|
49
LL | extern "C" fn vector_ret_small(x: &i8x8) -> i8x8 {
510
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ function defined here
611
|
712
= help: consider enabling it globally (`-C target-feature=+vector`) or locally (`#[target_feature(enable="vector")]`)
813

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

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

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

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

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

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

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

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

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

85-
error: aborting due to 10 previous errors
90+
error: aborting due to 10 previous errors; 1 warning emitted
8691

0 commit comments

Comments
 (0)