Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support input/output in vector registers of s390x inline assembly #131664

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

taiki-e
Copy link
Member

@taiki-e taiki-e commented Oct 13, 2024

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.

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 #130869.

cc #130869 about vector facility support in s390x
cc #125398 & #116909 about f128 support in asm

@rustbot label +O-SystemZ +A-inline-assembly

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. A-inline-assembly Area: Inline assembly (`asm!(…)`) O-SystemZ Target: SystemZ processors (s390x) S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. labels Oct 13, 2024
@taiki-e taiki-e mentioned this pull request Oct 13, 2024
10 tasks
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Oct 13, 2024
@bors
Copy link
Contributor

bors commented Oct 14, 2024

☔ The latest upstream changes (presumably #131672) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Oct 26, 2024

☔ The latest upstream changes (presumably #132152) made this pull request unmergeable. Please resolve the merge conflicts.

@bors
Copy link
Contributor

bors commented Nov 14, 2024

☔ The latest upstream changes (presumably #133006) made this pull request unmergeable. Please resolve the merge conflicts.

@taiki-e taiki-e changed the title Support #[repr(simd)] types in input/output of s390x inline assembly Support #[repr(simd)] types and floats in input/output of s390x inline assembly Nov 21, 2024
@taiki-e taiki-e marked this pull request as ready for review November 21, 2024 17:35
@rustbot
Copy link
Collaborator

rustbot commented Nov 21, 2024

Some changes occurred in compiler/rustc_codegen_gcc

cc @antoyo, @GuillaumeGomez

@taiki-e taiki-e changed the title Support #[repr(simd)] types and floats in input/output of s390x inline assembly Support #[repr(simd)] types in input/output of s390x inline assembly Nov 21, 2024
@taiki-e taiki-e force-pushed the s390x-asm-vreg-inout branch 2 times, most recently from d0a124a to 51506f9 Compare November 21, 2024 18:40
@taiki-e taiki-e changed the title Support #[repr(simd)] types in input/output of s390x inline assembly Support #[repr(simd)] types and floats in input/output of s390x inline assembly Nov 21, 2024
@taiki-e taiki-e changed the title Support #[repr(simd)] types and floats in input/output of s390x inline assembly Support input/output in vector registers of s390x inline assembly Nov 21, 2024
@taiki-e
Copy link
Member Author

taiki-e commented Nov 21, 2024

Vector ABI support (#131586) has been merged, and this is now ready for review.

cc @uweigand
r? @Amanieu

@rustbot label -S-blocked +S-waiting-on-review

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-blocked Status: Marked as blocked ❌ on something else such as an RFC or other implementation work. labels Nov 21, 2024
@Amanieu
Copy link
Member

Amanieu commented Nov 21, 2024

Is there a way to feature-gate this functionality? Since s390x asm support is stable, every change here needs to go through an FCP since it will instantly be stable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-inline-assembly Area: Inline assembly (`asm!(…)`) O-SystemZ Target: SystemZ processors (s390x) S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants