rust/compiler
Matthias Krüger e67d4499a6
Rollup merge of #135630 - folkertdev:s390x-target-features, r=Amanieu
add more `s390x` target features

Closes #88937

tracking issue: https://github.com/rust-lang/rust/issues/130869

The target feature names are, right now, just the llvm target feature names. These mostly line up well with the names of [Facility Indications](https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf#page=301) names. The linux kernel (and `/proc/cpuinfo`) uses shorter, more cryptic names. (e.g. "vector" is `vx`). We can deviate from the llvm names, but the CPU vendor (IBM) does not appear to use e.g. `vx` for what they call `vector`.

There are a number of implied target features between the vector facilities (based on the [Facility Indications](https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf#page=301) table):

- 129 The vector facility for z/Architecture is installed in the z/Architecture architectural mode.
- 134 The vector packed decimal facility is installed in the z/Architecture architectural mode. When bit 134 is one, bit 129 is also one.
- 135 The vector enhancements facility 1 is installed in the z/Architecture architectural mode. When bit 135 is one, bit 129 is also one.
- 148 The vector-enhancements facility 2 is installed in the z/Architecture architectural mode. When bit 148 is one, bits 129 and 135 are also one.
- 152 The vector-packed-decimal-enhancement facility 1 is installed in the z/Architecture architectural mode. When bit 152 is one, bits 129 and 134 are also one.
- 165 The neural-network-processing-assist facility is installed in the z/Architecture architectural mode. When bit 165 is one, bit 129 is also one.
- 192 The vector-packed-decimal-enhancement facility 2 is installed in the z/Architecture architectural mode. When bit 192 is one, bits 129, 134, and 152 are also one.

The remaining facilities do not have any implied target features (that we provide):

- 45 The distinct-operands, fast-BCR-serialization, high-word, and population-count facilities, the interlocked-access facility 1, and the load/store-oncondition facility 1 are installed in the z/Architecture architectural mode.
- 73 The transactional-execution facility is installed in the z/Architecture architectural mode. Bit 49 is one when bit 73 is one.
- 133 The guarded-storage facility is installed in the z/Architecture architectural mode.
- 150 The enhanced-sort facility is installed in the z/Architecture architectural mode.
- 151 The DEFLATE-conversion facility is installed in the z/Architecture architectural mode.

The added target features are those that have ISA implications, can be queried at runtime, and have LLVM support. LLVM [defines more target features](d49a2d2bc9/llvm/lib/Target/SystemZ/SystemZFeatures.td), but I'm not sure those are useful. They can always be added later, and can already be set globally using `-Ctarget-feature`.

I'll also update the `is_s390x_feature_supported` macro (added in https://github.com/rust-lang/stdarch/pull/1699, not yet on nightly, that needs an stdarch sync) to include these target features.

``@Amanieu`` you had some reservations about the `"vector"` target feature name. It does appear to be the most "official" name we have. On the one hand the name is very generic, and some of the other names are rather long. For the `neural-network-processing-assist` even LLVM thought that was a bit much and shortened it to `nnp-assist`. Also for `vector-packed-decimal-enhancement facility 1` the llvm naming is inconsistent. On the other hand, the cpuinfo names are very cryptic, and aren't found in the IBM documentation.

r? ``@Amanieu``

cc ``@uweigand`` ``@taiki-e``
2025-02-21 12:45:22 +01:00
..
rustc
rustc_abi Adjust LayoutData::uninhabited doc comment. 2025-02-20 13:41:24 -06:00
rustc_arena Add inherent versions of MaybeUninit methods for slices 2025-01-11 23:57:00 -05:00
rustc_ast Add a TyPat in the AST to reuse the generic arg lowering logic 2025-02-11 08:51:05 +00:00
rustc_ast_ir Make fewer crates depend on rustc_ast_ir 2025-02-19 07:06:54 +00:00
rustc_ast_lowering Move some Map methods onto TyCtxt. 2025-02-17 13:21:02 +11:00
rustc_ast_passes compiler: remove rustc_target reexport of rustc_abi::HashStableContext 2025-02-11 18:55:48 -08:00
rustc_ast_pretty Add a TyPat in the AST to reuse the generic arg lowering logic 2025-02-11 08:51:05 +00:00
rustc_attr_data_structures rustc_allowed_through_unstable_modules: require deprecation message 2025-02-02 12:36:12 +01:00
rustc_attr_parsing Rustfmt 2025-02-08 22:12:13 +00:00
rustc_baked_icu_data
rustc_borrowck Don't store a redundant span in user-type projections 2025-02-20 20:37:17 +11:00
rustc_builtin_macros Rollup merge of #136646 - oli-obk:pattern-types-ast, r=BoxyUwU 2025-02-12 06:07:37 +01:00
rustc_codegen_cranelift Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData. 2025-02-20 13:27:32 -06:00
rustc_codegen_gcc Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData. 2025-02-20 13:27:32 -06:00
rustc_codegen_llvm Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData. 2025-02-20 13:27:32 -06:00
rustc_codegen_ssa Rollup merge of #136985 - zachs18:backend-repr-remove-uninhabited, r=workingjubilee 2025-02-20 14:58:18 -08:00
rustc_const_eval fine-tune comment 2025-02-20 13:41:24 -06:00
rustc_data_structures Enforce T: Hash for Interned<...> 2025-02-17 21:35:52 -05:00
rustc_driver
rustc_driver_impl Rollup merge of #137151 - Urgau:register-more-signals, r=workingjubilee 2025-02-18 18:34:14 +01:00
rustc_error_codes fix: Alloc new errorcode E0803 for E0495 2025-02-15 12:18:30 +08:00
rustc_error_messages tree-wide: parallel: Fully removed all Lrc, replaced with Arc 2025-02-03 13:25:57 +03:00
rustc_errors Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
rustc_expand Reject macro calls inside of #![crate_name] 2025-02-15 16:47:30 +01:00
rustc_feature Rename pattern_complexity attr as pattern_complexity_limit. 2025-02-17 09:30:40 +11:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz Rustfmt 2025-02-08 22:12:13 +00:00
rustc_hashes Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
rustc_hir Move methods from Map to TyCtxt, part 2. 2025-02-18 10:17:44 +11:00
rustc_hir_analysis Restrict bevy hack 2025-02-19 03:58:31 +00:00
rustc_hir_pretty Overhaul the intravisit::Map trait. 2025-02-17 13:21:35 +11:00
rustc_hir_typeck Auto merge of #137295 - matthiaskrgr:rollup-tdu3t39, r=matthiaskrgr 2025-02-20 02:39:28 +00:00
rustc_incremental Move methods from Map to TyCtxt, part 2. 2025-02-18 10:17:44 +11:00
rustc_index Rustfmt 2025-02-08 22:12:13 +00:00
rustc_index_macros
rustc_infer Make fewer crates depend on rustc_ast_ir 2025-02-19 07:06:54 +00:00
rustc_interface Move methods from Map to TyCtxt, part 2. 2025-02-18 10:17:44 +11:00
rustc_lexer Rustfmt 2025-02-08 22:12:13 +00:00
rustc_lint Rollup merge of #128080 - estebank:out-of-scope-macro, r=petrochenkov 2025-02-21 12:45:21 +01:00
rustc_lint_defs Reword message 2025-02-20 17:55:31 +00:00
rustc_llvm Quote embedded codeview command line arguments 2025-02-14 11:02:28 +01:00
rustc_log
rustc_macros Make fewer crates depend on rustc_ast_ir 2025-02-19 07:06:54 +00:00
rustc_metadata Move methods from Map to TyCtxt, part 2. 2025-02-18 10:17:44 +11:00
rustc_middle Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData. 2025-02-20 13:27:32 -06:00
rustc_mir_build Don't store a redundant span in user-type projections 2025-02-20 20:37:17 +11:00
rustc_mir_dataflow Rollup merge of #137213 - nnethercote:rm-rustc_middle-mir-tcx, r=compiler-errors 2025-02-19 01:30:13 +01:00
rustc_mir_transform Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData. 2025-02-20 13:27:32 -06:00
rustc_monomorphize Register USAGE_OF_TYPE_IR_INHERENT, remove inherent usages 2025-02-19 07:19:27 +00:00
rustc_next_trait_solver Make fewer crates depend on rustc_ast_ir 2025-02-19 07:06:54 +00:00
rustc_parse Rollup merge of #137281 - estebank:doc-comment-syntax-error, r=compiler-errors 2025-02-20 00:55:16 +01:00
rustc_parse_format Rustfmt 2025-02-08 22:12:13 +00:00
rustc_passes Rollup merge of #136923 - samueltardieu:push-vxxqvqwspssv, r=davidtwco 2025-02-19 21:16:11 +01:00
rustc_pattern_analysis Add pattern_complexity_limit to Limits. 2025-02-17 09:30:33 +11:00
rustc_privacy Move methods from Map to TyCtxt, part 2. 2025-02-18 10:17:44 +11:00
rustc_query_impl Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
rustc_query_system Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
rustc_resolve Rollup merge of #128080 - estebank:out-of-scope-macro, r=petrochenkov 2025-02-21 12:45:21 +01:00
rustc_sanitizers check the types in ty::Value to value conversion 2025-01-30 18:13:16 +01:00
rustc_serialize Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
rustc_session Auto merge of #137164 - matthiaskrgr:rollup-dj5826k, r=matthiaskrgr 2025-02-17 11:18:33 +00:00
rustc_smir Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData. 2025-02-20 13:27:32 -06:00
rustc_span Restrict bevy hack 2025-02-19 03:58:31 +00:00
rustc_symbol_mangling Move hashes from rustc_data_structure to rustc_hashes so they can be shared with rust-analyzer 2025-02-16 16:18:30 -05:00
rustc_target Rollup merge of #135630 - folkertdev:s390x-target-features, r=Amanieu 2025-02-21 12:45:22 +01:00
rustc_trait_selection Rollup merge of #137263 - compiler-errors:inherentless, r=lcnr 2025-02-20 00:55:14 +01:00
rustc_traits Clean up dropck code a bit 2025-02-17 11:33:07 +00:00
rustc_transmute Make fewer crates depend on rustc_ast_ir 2025-02-19 07:06:54 +00:00
rustc_ty_utils Update check to reflect that non-ZST uninhabited types should not be PassMode::Ignore. 2025-02-20 13:41:11 -06:00
rustc_type_ir Rollup merge of #137262 - compiler-errors:ast-ir-begone, r=lcnr 2025-02-20 00:55:13 +01:00
rustc_type_ir_macros Make fewer crates depend on rustc_ast_ir 2025-02-19 07:06:54 +00:00
stable_mir Remove BackendRepr::Uninhabited, replaced with an uninhabited: bool field in LayoutData. 2025-02-20 13:27:32 -06:00