rust/compiler
Jubilee 2f98dcf9ba
Rollup merge of #131258 - taiki-e:s390x-stabilize-asm, r=Amanieu
Stabilize s390x inline assembly

This stabilizes inline assembly for s390x (SystemZ).

Corresponding reference PR: https://github.com/rust-lang/reference/pull/1643

---

From the requirements of stabilization mentioned in https://github.com/rust-lang/rust/issues/93335

> Each architecture needs to be reviewed before stabilization:

> - It must have clobber_abi.

Done in https://github.com/rust-lang/rust/pull/130630.

> - It must be possible to clobber every register that is normally clobbered by a function call.

Done in the PR that added support for clobber_abi.

> - Generally review that the exposed register classes make sense.

The followings can be used as input/output:

- `reg` (`r[0-10]`, `r[12-14]`): General-purpose register

- `reg_addr` (`r[1-10]`, `r[12-14]`): General-purpose register except `r0` which is evaluated as zero in an address context

  This class is needed because `r0`, which may be allocated when using the `reg` class, cannot be used as a register in certain contexts. This is identical to the `a` constraint in LLVM and GCC. See https://github.com/rust-lang/rust/pull/119431 for details.

- `freg` (`f[0-15]`): Floating-point register

The followings are clobber-only:

- `vreg` (`v[0-31]`): Vector register

  Technically `vreg` should be able to accept `#[repr(simd)]` types as input/output if the unstable `vector` target feature added is enabled, but `core::arch` has no s390x vector type and both `#[repr(simd)]` and `core::simd` are unstable. Everything related is unstable, so the fact that this is currently a clobber-only should not be considered a stabilization blocker. (https://github.com/rust-lang/rust/issues/130869 tracks unstable stuff here)

- `areg` (`a[2-15]`): Access register

All of the above register classes except `reg_addr` are needed for `clobber_abi`.

The followings cannot be used as operands for inline asm (see also [getReservedRegs](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/SystemZ/SystemZRegisterInfo.cpp#L258-L282) and [SystemZELFRegisters](https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/SystemZ/SystemZRegisterInfo.h#L107-L128) in LLVM):

- `r11`: frame pointer
- `r15`: stack pointer
- `a0`, `a1`: Reserved for system use
- `c[0-15]` (control register)  Reserved by the kernel

Although not listed in the above requirements, `preserves_flags` is implemented in https://github.com/rust-lang/rust/pull/111331.

---

cc ``@uweigand``

r? ``@Amanieu``

``@rustbot`` label +O-SystemZ +A-inline-assembly
2024-11-09 20:28:43 -08:00
..
rustc Remove unused intercrate dependencies 2024-11-07 14:17:16 +00:00
rustc_abi pointee_info_at: fix logic for recursing into enums 2024-11-08 07:35:29 +01:00
rustc_arena
rustc_ast Add documentation on ast::Attribute 2024-11-05 16:38:15 +01:00
rustc_ast_ir
rustc_ast_lowering Stabilize s390x inline assembly 2024-11-08 10:46:00 +09:00
rustc_ast_passes Rename the FIXMEs, remove a few that dont matter anymore 2024-11-03 18:59:41 +00:00
rustc_ast_pretty
rustc_attr remove support for extern-block const intrinsics 2024-11-04 23:27:45 +01:00
rustc_baked_icu_data
rustc_borrowck Get rid of check_opaque_type_well_formed 2024-11-08 03:46:27 +00:00
rustc_builtin_macros
rustc_codegen_cranelift Merge commit '1fa693ca4462fc1f790693464cf765ad693616af' into sync_cg_clif-2024-11-09 2024-11-09 13:48:06 +00:00
rustc_codegen_gcc remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead 2024-11-08 09:16:00 +01:00
rustc_codegen_llvm Add discriminators to DILocations when multiple functions are inlined into a single point. 2024-11-09 08:01:31 -08:00
rustc_codegen_ssa Rollup merge of #132774 - bjorn3:cranelift_lld, r=lqd 2024-11-09 19:16:45 +01:00
rustc_const_eval Rollup merge of #132057 - RalfJung:miri-abi-compat, r=wesleywiser 2024-11-07 13:08:27 +01:00
rustc_data_structures
rustc_driver
rustc_driver_impl Use a method to apply RustcOptGroup to getopts::Options 2024-11-08 12:46:39 +11:00
rustc_error_codes remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead 2024-11-08 09:16:00 +01:00
rustc_error_messages
rustc_errors Rename target triple to target tuple in many places in the compiler 2024-11-02 21:29:59 +01:00
rustc_expand Rollup merge of #132332 - nnethercote:use-token_descr-more, r=estebank 2024-10-30 06:40:36 +01:00
rustc_feature Rollup merge of #132552 - taiki-e:sparc-target-feature, r=workingjubilee 2024-11-09 10:52:03 +01:00
rustc_fluent_macro
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #132423 - RalfJung:const-eval-align-offset, r=dtolnay 2024-11-03 20:08:13 -08:00
rustc_hir_analysis Rollup merge of #132757 - compiler-errors:yeet-check-wf, r=lcnr 2024-11-08 20:46:12 -08:00
rustc_hir_pretty compiler: Switch to rustc_abi in hir_pretty, lint_defs, and mir_build 2024-10-30 22:38:49 -07:00
rustc_hir_typeck Don't suggest .into_iter() on iterators 2024-11-08 17:43:13 -08:00
rustc_incremental replace manual time convertions with std ones 2024-11-03 15:51:39 +03:00
rustc_index
rustc_index_macros
rustc_infer Manually register some bounds for a better span 2024-11-08 04:56:08 +00:00
rustc_interface Use a method to apply RustcOptGroup to getopts::Options 2024-11-08 12:46:39 +11:00
rustc_lexer Reject raw lifetime followed by \' as well 2024-10-30 01:13:18 +00:00
rustc_lint Rollup merge of #132095 - gechelberger:fix-131977, r=wesleywiser 2024-11-07 18:48:21 -08:00
rustc_lint_defs compiler: Switch to rustc_abi in hir_pretty, lint_defs, and mir_build 2024-10-30 22:38:49 -07:00
rustc_llvm Add discriminators to DILocations when multiple functions are inlined into a single point. 2024-11-09 08:01:31 -08:00
rustc_log
rustc_macros
rustc_metadata Rollup merge of #132131 - celinval:smir-crate-defs, r=compiler-errors 2024-11-07 18:48:22 -08:00
rustc_middle Rollup merge of #132799 - zachs18:str-primitive-symbol, r=compiler-errors 2024-11-09 19:16:46 +01:00
rustc_mir_build Auto merge of #132580 - compiler-errors:globs, r=Noratrieb 2024-11-05 08:30:56 +00:00
rustc_mir_dataflow compiler: Remove unused rustc_target from Cargo.tomls 2024-11-03 13:38:47 -08:00
rustc_mir_transform Rollup merge of #132389 - Zalathar:graph-tweaks, r=jieyouxu 2024-11-08 18:51:29 +11:00
rustc_monomorphize compiler: Add rustc_abi to _monomorphize 2024-11-02 20:31:47 -07:00
rustc_next_trait_solver Remove unused intercrate dependencies 2024-11-07 14:17:16 +00:00
rustc_parse Rollup merge of #132363 - compiler-errors:raw-lt-id-valid, r=wesleywiser 2024-11-09 19:16:43 +01:00
rustc_parse_format
rustc_passes remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead 2024-11-08 09:16:00 +01:00
rustc_pattern_analysis compiler: Remove unused rustc_target from Cargo.tomls 2024-11-03 13:38:47 -08:00
rustc_privacy Merge HostPolarity and BoundConstness 2024-10-30 16:23:16 +00:00
rustc_query_impl
rustc_query_system replace manual time convertions with std ones 2024-11-03 15:51:39 +03:00
rustc_resolve use verbose for path separator suggestion 2024-11-08 16:58:19 +00:00
rustc_sanitizers compiler: Add rustc_abi to _sanitizers 2024-11-02 20:31:47 -07:00
rustc_serialize
rustc_session Rollup merge of #132754 - Zalathar:opts, r=GuillaumeGomez,jieyouxu 2024-11-09 19:16:44 +01:00
rustc_smir Rollup merge of #132131 - celinval:smir-crate-defs, r=compiler-errors 2024-11-07 18:48:22 -08:00
rustc_span Rollup merge of #132552 - taiki-e:sparc-target-feature, r=workingjubilee 2024-11-09 10:52:03 +01:00
rustc_symbol_mangling ty::BrK -> ty::BoundRegionKind::K 2024-11-04 04:45:52 +00:00
rustc_target Rollup merge of #132785 - durin42:llvm-20-more-alignments, r=nikic 2024-11-09 10:52:05 +01:00
rustc_trait_selection Rollup merge of #132757 - compiler-errors:yeet-check-wf, r=lcnr 2024-11-08 20:46:12 -08:00
rustc_traits
rustc_transmute
rustc_ty_utils Make fn_abi_sanity_check a bit stricter 2024-11-07 15:54:40 +00:00
rustc_type_ir Rename the FIXMEs, remove a few that dont matter anymore 2024-11-03 18:59:41 +00:00
rustc_type_ir_macros
stable_mir Rollup merge of #132161 - celinval:smir-fix-indent, r=compiler-errors 2024-11-08 18:51:28 +11:00