Stabilize s390x vector target feature and is_s390x_feature_detected! macro by folkertdev · Pull Request #145656 · rust-lang/rust (original) (raw)

closes #145649
closes #135413
cc: #130869
reference PR: rust-lang/reference#1972

Stabilization report

Summary

This PR stabilizes the following s390x target features:

Additionally, it stabilizes the std::arch::is_s390x_feature_detected! macro itself and stably accepts the target features listed above.

Tests & ABI details

Only the vector target feature changes the ABI, much like e.g. avx2 it will, depending on the ABI, pass vector types in vector registers. This behavior is tested extensively:

The remaining features don't influence the ABI, they only influence instruction selection. In stdarch we test that the expected instructions are in fact generated when the target feature is enabled.

Implementation history

For is_s390x_feature_detected!:

For vector and friends

Unresolved questions

There is a fixme in tests/ui/abi/simd-abi-checks-s390x.rs:

// 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

I'm not sure whether that blocks stabilization?


The implementation first extracts the listed target features into their own s390x_target_feature_vector rust feature, and then stabilizes that. best reviewed commit-by-commit

r? @Amanieu
cc @uweigand @taiki-e