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

Arm64/Sve: Enable Sve only if vector length is 128 #104174

Merged
merged 4 commits into from
Jun 28, 2024

Conversation

kunalspathak
Copy link
Member

In .NET 9, we will only support SVE if the system vector length of 128-bits. For supporting higher vector length, needs more work that will be done in future release.

References:

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Jun 28, 2024
@kunalspathak kunalspathak added the arm-sve Work related to arm64 SVE/SVE2 support label Jun 28, 2024
Copy link
Contributor

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

@kunalspathak
Copy link
Member Author

@dotnet/arm64-contrib

src/coreclr/vm/codeman.cpp Outdated Show resolved Hide resolved
@jkotas jkotas requested a review from tannergooding June 28, 2024 19:41
Co-authored-by: Jan Kotas <jkotas@microsoft.com>
src/coreclr/vm/codeman.cpp Outdated Show resolved Hide resolved
@@ -1514,8 +1514,8 @@ void EEJitManager::SetCpuInfo()
uint32_t maxVectorTLength = (maxVectorTBitWidth / 8);
uint64_t sveLengthFromOS = GetSveLengthFromOS();
Copy link
Member

Choose a reason for hiding this comment

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

This method to be adjusted to return 0 on Windows with this change as otherwise we could be in an unsupported state since it's currently hardcoded as:

;; uint64_t GetSveLengthFromOS(void);
    LEAF_ENTRY GetSveLengthFromOS
        ;; TODO-SVE: Remove the hardcoded value 128 and uncomment once CI machines are updated to use MASM 14.4 or later
        ;; rdvl    x0, 1
        mov     x0, #128
        ret     lr
    LEAF_END

Copy link
Member Author

Choose a reason for hiding this comment

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

hhm, so this is the case where if windows is running on 256-bit machine, we shouldn't be returning 128-bits because that will falsely turn on SVE. Let me uncomment the right way to do it to see if helix machines got the assembler upgraded to understand rdvl.

Copy link
Member Author

Choose a reason for hiding this comment

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

alright, so that seemed to be working now.

@jkotas jkotas self-requested a review June 28, 2024 19:57
@kunalspathak kunalspathak merged commit 7f7bb7b into dotnet:main Jun 28, 2024
89 checks passed
@kunalspathak kunalspathak deleted the sve-128 branch June 28, 2024 23:10
@github-actions github-actions bot locked and limited conversation to collaborators Jul 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI arm-sve Work related to arm64 SVE/SVE2 support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants