Skip to content

[S390X] Add simd fallback support for unsupported s390x architectures - #118376

Merged
akoeplinger merged 4 commits into
dotnet:mainfrom
saitama951:add_fallback
Aug 18, 2025
Merged

[S390X] Add simd fallback support for unsupported s390x architectures#118376
akoeplinger merged 4 commits into
dotnet:mainfrom
saitama951:add_fallback

Conversation

@saitama951

@saitama951saitama951 commented Aug 5, 2025

Copy link
Copy Markdown
Contributor

Vector facility was introduced in the z13, which majorly introduces vector int/short/long/double variants of the vector instructions. with the release of z14 we introduced vector float variant and vector max/min as part of vector enhancement facility 1.
with my previous patches #116779, #116669
we have already added support to z14 and above generations.

this patch supports z13 and previous generations

@github-actionsgithub-actionsBot added the needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners label Aug 5, 2025
@dotnet-policy-servicedotnet-policy-serviceBot added the community-contribution Indicates that the PR has been added by a community member label Aug 5, 2025
@risc-vv

Copy link
Copy Markdown

@dotnet/samsung Could you please take a look? These changes may be related to riscv64.

@kasperk81kasperk81 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tab indentation

Comment threadsrc/mono/mono/mini/simd-intrinsics.c Outdated
Comment threadsrc/mono/mono/mini/simd-intrinsics.c Outdated
Comment threadsrc/mono/mono/mini/simd-intrinsics.c Outdated
Comment threadsrc/mono/mono/mini/simd-intrinsics.c Outdated
Comment threadsrc/mono/mono/mini/simd-intrinsics.c Outdated
@saitama951

Copy link
Copy Markdown
ContributorAuthor

@uweigand can you please review this?

@saitama951
saitama951force-pushed the add_fallback branch 2 times, most recently from 159b67b to 96e621bCompareAugust 5, 2025 09:11
Vector facility was introduced in the z13, which majorly
introduces vector int/short/long/double variants of the
vector instructions. with the release of z14 we introduced
vector float variant as part of vector enhancement facility 1.
This patch majorly supports z13 and previous generations.
fix code style
Co-authored-by: kasperk81 <83082615+kasperk81@users.noreply.github.com>
@jkotasjkotas added area-Codegen-JIT-mono arch-wasm WebAssembly architecture arch-s390x Related to s390x architecture (unsupported) and removed needs-area-label An area label is needed to ensure this gets routed to the appropriate area owners arch-wasm WebAssembly architecture labels Aug 5, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @steveisok, @vitek-karas
See info in area-owners.md if you want to be subscribed.

* fix test case failures on arm64
* fix more code style reviews

@uweiganduweigand left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the inline comments, you should also fix this:

#define MONO_ARCH_SIMD_INTRINSICS mono_hwcap_s390x_has_vec

and define it to just 1 like everywhere else, since this is not actually evaluated at run-time.

Comment threadsrc/mono/mono/mini/simd-intrinsics.c Outdated
Comment threadsrc/mono/mono/mini/simd-intrinsics.c Outdated
Comment threadsrc/mono/mono/mini/simd-intrinsics.c Outdated
Comment threadsrc/mono/mono/mini/simd-intrinsics.c
Comment threadsrc/mono/mono/mini/simd-intrinsics.c Outdated
Comment threadsrc/mono/mono/mini/mini.h

@uweiganduweigand left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This version looks good to me now from a s390x target perspective.

@saitama951

Copy link
Copy Markdown
ContributorAuthor

@akoeplinger can this be merged?

@akoeplinger

Copy link
Copy Markdown
Member

/ba-g failures are unrelated to s390x changes

@akoeplinger
akoeplinger merged commit 4e7ba24 into dotnet:mainAug 18, 2025
74 of 80 checks passed
@saitama951

Copy link
Copy Markdown
ContributorAuthor

@akoeplinger can we backport this to release/10.0 as well?

@akoeplinger

Copy link
Copy Markdown
Member

@lewing do we have a policy for changes which only touch community-supported arch code?

@saitama951

Copy link
Copy Markdown
ContributorAuthor

@lewing gentle ping.

@lewing do we have a policy for changes which only touch community-supported arch code?

@giritrivedi

Copy link
Copy Markdown
Contributor

@akoeplinger , @lewing - Can we have this backported ? or is there a policy which restricts us from backporting ?

@lewing

Copy link
Copy Markdown
Member

/backport to release/10.0

@github-actions

Copy link
Copy Markdown
Contributor

Started backporting to release/10.0: https://github.com/dotnet/runtime/actions/runs/17413301220

@github-actionsgithub-actionsBot locked and limited conversation to collaborators Oct 3, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

arch-s390xRelated to s390x architecture (unsupported)area-Codegen-JIT-monocommunity-contributionIndicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants

@saitama951@risc-vv@akoeplinger@giritrivedi@lewing@uweigand@kasperk81@jkotas