From 276954590a30efa972227207aba771157fc862fe Mon Sep 17 00:00:00 2001 From: Folkert de Vries Date: Wed, 20 Aug 2025 16:16:02 +0200 Subject: [PATCH 1/2] specify s390x target features --- src/attributes/codegen.md | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/src/attributes/codegen.md b/src/attributes/codegen.md index 24e4c2c3a..bb446130d 100644 --- a/src/attributes/codegen.md +++ b/src/attributes/codegen.md @@ -506,6 +506,30 @@ Feature | Implicitly Enables | Description [tail-call]: https://github.com/webassembly/tail-call [multivalue]: https://github.com/webassembly/multi-value +r[attributes.codegen.target_feature.s390x] +#### `s390x` + +On this platform the usage of `#[target_feature]` functions follows the [above restrictions][attributes.codegen.target_feature.safety-restrictions]. + +Further documentation on these features can be found in the "Additions to z/Architecture" section of Chapter 1 of the [Principles of Operation]. + +Feature | Implicitly Enables | Description +---------------------------------------|---------------------------------------|--------------------- +`vector` | | 128-bit vector instructions +`vector-enhancements-1` | `vector` | vector enhancements 1 +`vector-enhancements-2` | `vector-enhancements-1` | vector enhancements 2 +`vector-enhancements-3` | `vector-enhancements-2` | vector enhancements 3 +`vector-packed-decimal` | `vector` | vector packed-decimal +`vector-packed-decimal-enhancement` | `vector-packed-decimal` | vector packed-decimal enhancement +`vector-packed-decimal-enhancement-2` | `vector-packed-decimal-enhancement-2` | vector packed-decimal enhancement 2 +`vector-packed-decimal-enhancement-3` | `vector-packed-decimal-enhancement-3` | vector packed-decimal enhancement 3 +`nnp-assist` | `vector` | nnp assist +`miscellaneous-extensions-2` | | miscellaneous extensions 2 +`miscellaneous-extensions-3` | | miscellaneous extensions 3 +`miscellaneous-extensions-4` | | miscellaneous extensions 4 + +[Principles of Operation]: https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf + r[attributes.codegen.target_feature.info] ### Additional information @@ -516,8 +540,7 @@ that this option is not affected by the `target_feature` attribute, and is only driven by the features enabled for the entire crate. r[attributes.codegen.target_feature.remark-rt] -See the [`is_x86_feature_detected`] or [`is_aarch64_feature_detected`] macros -in the standard library for runtime feature detection on these platforms. +Whether a feature is enabled can be checked at runtime using a platform-specific macro from the standard library, for instance [`is_x86_feature_detected`] or [`is_aarch64_feature_detected`]. > [!NOTE] > `rustc` has a default set of features enabled for each target and CPU. The CPU may be chosen with the [`-C target-cpu`] flag. Individual features may be enabled or disabled for an entire crate with the [`-C target-feature`] flag. From 4ec04bcd06e9fe235653d0767dcb94130b345eda Mon Sep 17 00:00:00 2001 From: Travis Cross Date: Wed, 20 Aug 2025 18:21:11 +0000 Subject: [PATCH 2/2] Revise `s390x` codegen text --- src/attributes/codegen.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/attributes/codegen.md b/src/attributes/codegen.md index bb446130d..e8afe711c 100644 --- a/src/attributes/codegen.md +++ b/src/attributes/codegen.md @@ -509,9 +509,9 @@ Feature | Implicitly Enables | Description r[attributes.codegen.target_feature.s390x] #### `s390x` -On this platform the usage of `#[target_feature]` functions follows the [above restrictions][attributes.codegen.target_feature.safety-restrictions]. +On `s390x` targets, use of functions with the `#[target_feature]` attribute follows the [above restrictions][attributes.codegen.target_feature.safety-restrictions]. -Further documentation on these features can be found in the "Additions to z/Architecture" section of Chapter 1 of the [Principles of Operation]. +Further documentation on these features can be found in the "Additions to z/Architecture" section of Chapter 1 of the *[z/Architecture Principles of Operation]*. Feature | Implicitly Enables | Description ---------------------------------------|---------------------------------------|--------------------- @@ -528,7 +528,7 @@ Feature | Implicitly Enables | `miscellaneous-extensions-3` | | miscellaneous extensions 3 `miscellaneous-extensions-4` | | miscellaneous extensions 4 -[Principles of Operation]: https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf +[z/Architecture Principles of Operation]: https://publibfp.dhe.ibm.com/epubs/pdf/a227832d.pdf r[attributes.codegen.target_feature.info] ### Additional information