Conversation
|
Note regarding the This serves as a reminder for when your PR is modifying a ref *.cs file and adding/modifying public APIs, please make sure the API implementation in the src *.cs file is documented with triple slash comments, so the PR reviewers can sign off that change. |
|
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch Issue DetailsAdds empty System/Runtime/Intrinsics/Arm/Sve.cs and hwintrinsiclistarm64sve.h.
|
|
Extracted from #94765 Not sure if the Arm64_Sve parts are required or if it should only be Sve. I think we want the readytorun/crossgen changes too (but it should be disabled for them?) When run on a Arm64 Neoverse V1, the test program correctly outputs "SVE is supported." |
3379c17 to
4ad982f
Compare
|
Rebased off head as Kunal's work isn't dependant on this work. |
kunalspathak
left a comment
There was a problem hiding this comment.
Early version looks good. Added some questions.
| /// </summary> | ||
| [Intrinsic] | ||
| [CLSCompliant(false)] | ||
| public abstract class Sve : AdvSimd |
There was a problem hiding this comment.
what is an example of APIs that goes in Sve vs. Sve.Arm64? I thought we wanted something like System.Runtime.Instrinsics.Arm.Sve and System.Runtime.Instrinsics.Arm.Sve2?
There was a problem hiding this comment.
The general setup is that Isa exists to hold APIs that work on any arm platform
Isa.Arm32 exists to hold APIs that only work on Arm32
Isa.Arm64 exists to hold APIs that only work on Arm64 (we then have Isa.X64 for xarch)
SVE is interesting because there are many APIs that "could" work on Arm32, but there are currently no plans (based on a prior discussion on one of the proposals) to expose that support there.
This means Arm64 may be empty, but it must exist for usability reasons since Sve inherits from AdvSimd and otherwise Sve.Arm64.IsSupported would resolve to AdvSimd.Arm64.IsSupported and would lead users into a pit of failure, thinking it meant Sve.IsSupported would also be true
There was a problem hiding this comment.
ok, I didn't pay attention to : AdvSimd portion actually. I am wondering why Sve and Sve.Arm64 do not inherit from ArmBase and ArmBase.Arm64 respectively? I assume there will be a separate class for Sve2 next to Sve class.
There was a problem hiding this comment.
SVE inherits from AdvSimd because it requires AdvSimd support to exist and so it makes it overall more convenient for the user
AdvSimd then inherits from ArmBase itself
| AddInstructionSet(InstructionSet_Sha1_Arm64); | ||
| if (HasInstructionSet(InstructionSet_Sha256)) | ||
| AddInstructionSet(InstructionSet_Sha256_Arm64); | ||
| if (HasInstructionSet(InstructionSet_Sve)) |
There was a problem hiding this comment.
same here, want to understand difference between InstructionSet_Sve vs. InstructionSet_Sve_Arm64 instead of InstructionSet_Sve and InstructionSet_Sve2.
There was a problem hiding this comment.
It doesn't look like this PR is adding Sve2
There was a problem hiding this comment.
sure, what I was trying to get is that since we have generated boiler plate code for encodings, etc. of both SVE and SVE2 instructions and we should define SVE2 as well (instead of doing it in future PR).
There was a problem hiding this comment.
There is a ton of work to do and we should really focus on finishing SVE before we start on Sve2, IMO
We don’t want to be in a scenario where we leave Sve2 incomplete and half done because we didn’t have enough time for everything
There was a problem hiding this comment.
Alternative suggestion: We should focus first on the the instructions that give extra functionality that are not in NEON and will be useful for the existing SDK libraries. That may include some SVE2 instructions. Doing that would ensure some performance uplift for .NET9.
On my TODO list is to rewrite some of the SDK routines in SVE and see if I can find any performance improvements. Then use that to prioritise the SVE work.
There was a problem hiding this comment.
It would definitely be helpful to know what that list is.
Having an incomplete ISA is generally something we try to avoid as it can lead to issues when exposing APIs later, missed functionality, etc.
|
|
||
| if (test.IsSupported) | ||
| { | ||
| Console.WriteLine("SVE is supported."); |
There was a problem hiding this comment.
did you verify on SVE hardware if the CPU flags are returned and set correctly?
There was a problem hiding this comment.
Yes - both with and without:
Graviton 3:
❯ $CORE_ROOT/corerun /home/alahay01/dotnet/runtime_sve/artifacts/tests/coreclr/linux.arm64.Release/JIT/HardwareIntrinsics/Arm/Sve/Sve/Sve.dll
SVE is supported.
Altra:
❯ $CORE_ROOT/corerun /home/alahay01/dotnet/runtime_sve/artifacts/tests/coreclr/linux.arm64.Release/JIT/HardwareIntrinsics/Arm/Sve/Sve/Sve.dll
SVE is not supported.
What OS and version are the builds run on? Surprised this does not exist. |
tannergooding
left a comment
There was a problem hiding this comment.
LGTM, but we can't merge until after API review has happened.
All .NET Linux builds are done inside a CBL-Mariner docker container. You can see the details if you look at the "Initializing containers" step of the build, e.g.: https://dev.azure.com/dnceng-public/public/_build/results?buildId=471209&view=logs&jobId=3f327aea-bfb2-5154-7b3c-2691dcdd6bb2&j=3f327aea-bfb2-5154-7b3c-2691dcdd6bb2&t=aa810107-5ca4-4707-8689-54adfbc0a8ea. In this case, it looks like the container is @sbomer is the expert on these: @sbomer or @a74nh do you know why Mariner might be missing the |
|
Looks like maybe SVE support should have shown up in Linux kernels from 5.15 in around 2017? https://www.kernel.org/doc/html/v5.15/arm64/sve.html |
Mariner is used for WSL. It's possible this has been disabled due to Windows not yet supporting SVE. I'll add the following: That's safe as the kernel is never going to return that value on Mariner. It's also what we did in gdb and also one of the utilities in the Linux kernel is doing is too. |
To get this merged, we only need to get one piece of the API reviewed? |
|
With InstructionSet changes in a separate PR #95021 , this PR just adds the empty |
Done! |
|
After discussion with @kunalspathak, this PR is mostly pointless now. Closing. |
Adds empty System/Runtime/Intrinsics/Arm/Sve.cs and hwintrinsiclistarm64sve.h.
Plus all connecting code.
Many of the files touched here are autogenerated via InstructionSetDesc.txt.