rust/compiler
Matthias Krüger 7d63382000
Rollup merge of #145656 - folkertdev:stabilize-s390x-vector, r=Amanieu
Stabilize s390x `vector` target feature and `is_s390x_feature_detected!` macro

closes https://github.com/rust-lang/rust/issues/145649
closes https://github.com/rust-lang/rust/issues/135413
cc: https://github.com/rust-lang/rust/issues/130869
reference PR: https://github.com/rust-lang/reference/pull/1972

# Stabilization report

## Summary

This PR stabilizes the following s390x target features:

- `vector`
- `vector-enhancements-1`
- `vector-enhancements-2`
- `vector-enhancements-3`
- `vector-packed-decimal`
- `vector-packed-decimal-enhancement`
- `vector-packed-decimal-enhancement-2`
- `vector-packed-decimal-enhancement-3`
- `nnp-assist`
- `miscellaneous-extensions-2`
- `miscellaneous-extensions-3`
- `miscellaneous-extensions-4`

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:

- [tests/assembly-llvm/s390x-vector-abi.rs](22a86f8280/tests/assembly-llvm/s390x-vector-abi.rs)
- [tests/codegen-llvm/s390x-simd.rs](22a86f8280/tests/assembly-llvm/s390x-vector-abi.rs)
- [tests/ui/abi/simd-abi-checks-s390x.rs ](22a86f8280/tests/ui/abi/simd-abi-checks-s390x.rs )

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!`:

- https://github.com/rust-lang/stdarch/pull/1699
- https://github.com/rust-lang/rust/pull/138275
- https://github.com/rust-lang/stdarch/pull/1720
- https://github.com/rust-lang/stdarch/pull/1832

For `vector` and friends

- https://github.com/rust-lang/rust/pull/127506
- https://github.com/rust-lang/rust/pull/135630
- https://github.com/rust-lang/rust/pull/141250

## Unresolved questions

There is a fixme in [tests/ui/abi/simd-abi-checks-s390x.rs](22a86f8280/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`
2025-11-08 15:42:19 +01:00
..
rustc Make llvm_enzyme a regular cargo feature 2025-09-15 15:31:56 +00:00
rustc_abi Rollup merge of #148518 - bjorn3:unify_compiler_doc_config, r=GuillaumeGomez 2025-11-05 21:28:29 +01:00
rustc_arena Allow internal_features lint in doc tests 2025-11-05 11:25:29 +00:00
rustc_ast Auto merge of #147029 - neuschaefer:memchr-2.7.6, r=marcoieni 2025-11-07 21:58:38 +00:00
rustc_ast_ir Implement pattern matching for &pin mut|const T 2025-10-30 07:56:16 +08:00
rustc_ast_lowering Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_ast_passes Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_ast_pretty Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_attr_parsing Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_baked_icu_data Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_borrowck Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_builtin_macros Add typo suggestion for a misspelt Cargo environment variable 2025-11-06 23:10:39 +08:00
rustc_codegen_cranelift Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_codegen_gcc Add -Zannotate-moves for profiler visibility of move/copy operations 2025-11-06 15:39:45 -08:00
rustc_codegen_llvm Auto merge of #147803 - jsgf:move-copy-codegen, r=madsmtm,saethlin 2025-11-08 07:57:14 +00:00
rustc_codegen_ssa Auto merge of #147803 - jsgf:move-copy-codegen, r=madsmtm,saethlin 2025-11-08 07:57:14 +00:00
rustc_const_eval Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_data_structures Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_driver Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_driver_impl Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_error_codes Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_error_messages Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_errors Auto merge of #148188 - Muscraft:annotate-snippets-default-on-nightly, r=estebank 2025-11-06 11:45:06 +00:00
rustc_expand Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_feature stabilize s390x_target_feature_vector 2025-11-06 12:49:48 +01:00
rustc_fluent_macro Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_fs_util Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_graphviz Allow internal_features lint in doc tests 2025-11-05 11:25:29 +00:00
rustc_hashes some cleanups in compiler 2025-10-12 08:08:30 +00:00
rustc_hir Add -Zannotate-moves for profiler visibility of move/copy operations 2025-11-06 15:39:45 -08:00
rustc_hir_analysis Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_hir_id rustc_hir_id: Add a comment explaining why the crate exists 2025-08-20 15:04:00 -07:00
rustc_hir_pretty Rollup merge of #139751 - frank-king:feature/pin-project, r=Nadrieril,traviscross 2025-11-01 08:25:44 +01:00
rustc_hir_typeck Fix incorrect precedence caused by range expression 2025-11-06 17:34:48 +08:00
rustc_incremental Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_index Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_index_macros Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_infer Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_interface Add -Zannotate-moves for profiler visibility of move/copy operations 2025-11-06 15:39:45 -08:00
rustc_lexer Update memchr to 2.7.6 2025-09-26 17:53:49 +02:00
rustc_lint Rollup merge of #143037 - androm3da:bcain/hexagon_regspan_label, r=Amanieu 2025-11-06 14:07:15 +11:00
rustc_lint_defs do not complain about enums where all discriminants fit into a c_uint 2025-11-04 11:44:55 +01:00
rustc_llvm Fix device code generation, to account for an implicit dyn_ptr argument. 2025-11-06 03:34:38 -05:00
rustc_log Restrict sysroot crate imports to those defined in this repo. 2025-10-15 13:17:25 +01:00
rustc_macros use declarative macro for #[derive(TryFromU32)] 2025-10-06 14:54:38 +00:00
rustc_metadata Rollup merge of #147043 - ilovepi:default-sanitizers, r=petrochenkov 2025-11-06 14:07:16 +11:00
rustc_middle Fix ICE from async closure variance 2025-11-06 11:18:38 +08:00
rustc_mir_build Rollup merge of #147642 - camelid:misc-const-fixes, r=BoxyUwU 2025-11-02 15:56:48 +01:00
rustc_mir_dataflow Put Analysis back into Results. 2025-10-28 10:26:50 +11:00
rustc_mir_transform Auto merge of #147641 - cjgillot:liveness-cache-strings, r=estebank 2025-11-07 09:50:49 +00:00
rustc_monomorphize error on non-rustic ABIs using unsized parameters 2025-11-05 12:12:10 +01:00
rustc_next_trait_solver Rollup merge of #148292 - adwinwhite:assemble_object_candidate, r=lcnr 2025-11-06 12:29:58 +01:00
rustc_parse feat: Always use annotate-snippets for Unicode output 2025-11-05 09:01:07 -07:00
rustc_parse_format Allow internal_features lint in doc tests 2025-11-05 11:25:29 +00:00
rustc_passes Rollup merge of #148518 - bjorn3:unify_compiler_doc_config, r=GuillaumeGomez 2025-11-05 21:28:29 +01:00
rustc_pattern_analysis split definition and use site hidden tys 2025-10-31 14:48:43 +01:00
rustc_privacy Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_proc_macro Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_public Allow internal_features lint in doc tests 2025-11-05 11:25:29 +00:00
rustc_public_bridge Allow internal_features lint in doc tests 2025-11-05 11:25:29 +00:00
rustc_query_impl Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_query_system fix dev guide link in rustc_query_system/dep_graph/README.MD 2025-11-06 17:17:03 +05:00
rustc_resolve Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_sanitizers Rollup merge of #144936 - rcvalle:rust-cfi-fix-144641, r=lcnr 2025-10-28 20:39:32 +11:00
rustc_serialize Allow internal_features lint in doc tests 2025-11-05 11:25:29 +00:00
rustc_session Add -Zannotate-moves for profiler visibility of move/copy operations 2025-11-06 15:39:45 -08:00
rustc_span Rollup merge of #145656 - folkertdev:stabilize-s390x-vector, r=Amanieu 2025-11-08 15:42:19 +01:00
rustc_symbol_mangling Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_target Rollup merge of #145656 - folkertdev:stabilize-s390x-vector, r=Amanieu 2025-11-08 15:42:19 +01:00
rustc_thread_pool some cleanups in compiler 2025-10-12 08:08:30 +00:00
rustc_trait_selection Rollup merge of #147416 - Kivooeo:ice-fix23456, r=fmease 2025-11-07 00:21:18 -05:00
rustc_traits Auto merge of #146096 - adwinwhite:handle_normalization_overflow_in_mono1, r=saethlin 2025-10-13 00:20:10 +00:00
rustc_transmute prefer to use repeat_n over repeat and take 2025-10-09 01:24:55 +08:00
rustc_ty_utils Unify the configuration of the compiler docs 2025-11-05 11:25:27 +00:00
rustc_type_ir Rollup merge of #148153 - osamakader:fix-duplicate-the, r=JonathanBrouwer 2025-10-27 22:13:23 +11:00
rustc_type_ir_macros compiler: Fix a couple issues around cargo feature unification 2025-10-31 14:14:05 -04:00
rustc_windows_rc [win] Use find-msvc-tools instead of cc to find the linker and rc on Windows 2025-09-19 12:00:30 -07:00