rust/compiler/rustc_codegen_llvm/src
Matthias Krüger 3f86eddf83
Rollup merge of #131664 - taiki-e:s390x-asm-vreg-inout, r=Amanieu
Support input/output in vector registers of s390x inline assembly (under asm_experimental_reg feature)

This extends currently clobber-only vector registers (`vreg`) support to allow passing `#[repr(simd)]` types, floats (f32/f64/f128), and integers (i32/i64/i128) as input/output.

This is unstable and gated under new `#![feature(asm_experimental_reg)]` (tracking issue: https://github.com/rust-lang/rust/issues/133416). If the feature is not enabled, only clober is supported as before.

| Architecture | Register class | Target feature | Allowed types |
| ------------ | -------------- | -------------- | -------------- |
| s390x | `vreg` | `vector` | `i32`, `f32`, `i64`, `f64`, `i128`, `f128`, `i8x16`, `i16x8`, `i32x4`, `i64x2`, `f32x4`, `f64x2` |

This matches the list of types that are supported by the vector registers in LLVM:
https://github.com/llvm/llvm-project/blob/llvmorg-19.1.0/llvm/lib/Target/SystemZ/SystemZRegisterInfo.td#L301-L313

In addition to `core::simd` types and floats listed above, custom `#[repr(simd)]` types of the same size and type are also allowed. All allowed types other than i32/f32/i64/f64/i128, and relevant target features are currently unstable.

Currently there is no SIMD type for s390x in `core::arch`, but this is tracked in https://github.com/rust-lang/rust/issues/130869.

cc https://github.com/rust-lang/rust/issues/130869 about vector facility support in s390x
cc https://github.com/rust-lang/rust/issues/125398 & https://github.com/rust-lang/rust/issues/116909 about f128 support in asm

`@rustbot` label +O-SystemZ +A-inline-assembly
2024-11-25 07:01:37 +01:00
..
back embed-bitcode is no longer used in iOS 2024-11-24 15:51:47 +08:00
coverageinfo Rollup merge of #132675 - Zalathar:empty-spans, r=jieyouxu 2024-11-10 17:43:07 +01:00
debuginfo When the required discriminator value exceeds LLVM's limits, drop the debug info for the function instead of panicking. 2024-11-19 05:19:09 -08:00
llvm Rollup merge of #127483 - BertalanD:no_sanitize-global-var, r=rcvalle 2024-11-23 20:19:51 +08:00
abi.rs compiler: Directly use rustc_abi in codegen 2024-11-03 12:30:32 -08:00
allocator.rs Clean up FFI calls for operand bundles 2024-10-30 13:26:24 +11:00
asm.rs Rollup merge of #131664 - taiki-e:s390x-asm-vreg-inout, r=Amanieu 2024-11-25 07:01:37 +01:00
attributes.rs Rollup merge of #132259 - mrkajetanp:branch-protection-pauth-lr, r=davidtwco 2024-11-05 20:10:49 +01:00
base.rs Allow disabling ASan instrumentation for globals 2024-11-02 22:35:34 +01:00
builder.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
callee.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
common.rs Clean up FFI calls for operand bundles 2024-10-30 13:26:24 +11:00
consts.rs Rollup merge of #127483 - BertalanD:no_sanitize-global-var, r=rcvalle 2024-11-23 20:19:51 +08:00
context.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
declare.rs Use a type-safe helper to cast &str and &[u8] to *const c_char 2024-10-28 21:31:32 +11:00
errors.rs mark some target features as 'forbidden' so they cannot be (un)set 2024-11-04 22:56:47 +01:00
intrinsic.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
lib.rs Pass owned CodegenResults to link_binary 2024-11-09 21:22:00 +00:00
llvm_util.rs target_features: explain what exacty 'implied' means here 2024-11-11 07:33:39 +01:00
mono_item.rs use TypingEnv when no infcx is available 2024-11-18 10:38:56 +01:00
type_.rs compiler: Directly use rustc_abi in codegen 2024-11-03 12:30:32 -08:00
type_of.rs compiler: rustc_abi::Abi => BackendRepr 2024-10-29 14:56:00 -07:00
va_arg.rs compiler: Directly use rustc_abi in codegen 2024-11-03 12:30:32 -08:00
value.rs Add warn(unreachable_pub) to rustc_codegen_llvm. 2024-08-16 08:46:57 +10:00