Uh oh!
There was an error while loading. Please reload this page.
Add SHA3 and SVE SHA3 APIs - #126941
Conversation
a74nh
commented
Apr 15, 2026
@dhartglassMSFT @dotnet/arm64-contrib |
Uh oh!
There was an error while loading. Please reload this page.
a74nh
commented
May 11, 2026
This is erroring with: |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds new ARM64 hardware intrinsics for Sha3 and SveSha3 (including JIT recognition/codegen paths) and wires up corresponding generated JIT tests.
Changes:
- Introduces
System.Runtime.Intrinsics.Arm.Sha3andSystem.Runtime.Intrinsics.Arm.SveSha3APIs (ref + implementation + linker substitutions). - Extends CoreCLR JIT intrinsic tables and codegen to support Sha3/SveSha3 instructions (including immediates and containment).
- Adds generated test groups/projects and helper methods for validating Sha3/SveSha3 behaviors.
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/JIT/HardwareIntrinsics/Arm/SveSha3/SveSha3_ro.csproj | Adds optimized test project for SveSha3 ISA coverage. |
| src/tests/JIT/HardwareIntrinsics/Arm/SveSha3/SveSha3_r.csproj | Adds non-optimized test project for SveSha3 ISA coverage. |
| src/tests/JIT/HardwareIntrinsics/Arm/SveSha3/Program.SveSha3.cs | Adds test entrypoint scaffold for SveSha3 tests. |
| src/tests/JIT/HardwareIntrinsics/Arm/Shared/Program.cs | Logs new Sha3/SveSha3 ISA support flags. |
| src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs | Adds helper ops used by Sha3/SveSha3 test validation. |
| src/tests/JIT/HardwareIntrinsics/Arm/Sha3/Sha3_ro.csproj | Adds optimized test project for Sha3 ISA coverage. |
| src/tests/JIT/HardwareIntrinsics/Arm/Sha3/Sha3_r.csproj | Adds non-optimized test project for Sha3 ISA coverage. |
| src/tests/JIT/HardwareIntrinsics/Arm/Sha3/Program.Sha3.cs | Adds test entrypoint scaffold for Sha3 tests. |
| src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs | Hooks new Sha3/SveSha3 test groups into generator flow. |
| src/tests/Common/GenerateHWIntrinsicTests/Arm/SveTests.cs | Adds SveSha3Inputs test group definitions. |
| src/tests/Common/GenerateHWIntrinsicTests/Arm/AdvSimdTests.cs | Adds Sha3Inputs test group definitions. |
| src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs | Adds public surface area definitions for Sha3/SveSha3. |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/SveSha3.cs | Adds CoreLib implementation stub for SveSha3 intrinsics. |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/SveSha3.PlatformNotSupported.cs | Adds non-supported fallback stubs for SveSha3 APIs. |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sha3.cs | Adds CoreLib implementation stub for Sha3 intrinsics. |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sha3.PlatformNotSupported.cs | Adds non-supported fallback stubs for Sha3 APIs. |
| src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems | Includes new Sha3/SveSha3 files in CoreLib build. |
| src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoArmIntrinsics.xml | Stubs IsSupported for new ISAs when Arm intrinsics are disabled. |
| src/coreclr/jit/lsraarm64.cpp | Updates LSRA immediate handling for new/adjusted intrinsics. |
| src/coreclr/jit/lowerarmarch.cpp | Adds containment handling for Sha3 immediate operand. |
| src/coreclr/jit/hwintrinsiclistarm64sve.h | Defines SveSha3 intrinsic list entry for RAX1. |
| src/coreclr/jit/hwintrinsiclistarm64.h | Defines Sha3 intrinsic list entries (BCAX/EOR3/RAX1/XAR). |
| src/coreclr/jit/hwintrinsiccodegenarm64.cpp | Extends codegen to support 3-arg immediates and Sha3 opt selection. |
| src/coreclr/jit/hwintrinsicarm64.cpp | Adds immediate bounds for Sha3 XAR. |
| src/coreclr/jit/hwintrinsic.cpp | Enables ISA ranges for Sha3 and SveSha3. |
Comments suppressed due to low confidence (4)
src/tests/Common/GenerateHWIntrinsicTests/Arm/AdvSimdTests.cs:1
- The generated validation expression uses
&~inside a C# source string (e.g.secondOp[i] &~ thirdOp[i]), which is not valid C# syntax and will cause generated tests to fail compilation. Update theseValidateIterResultstrings to use& ~thirdOp[i](with a space) and keep the intended parentheses.
src/tests/Common/GenerateHWIntrinsicTests/Arm/AdvSimdTests.cs:1 - The
*_longSha3 test cases generateInt16inputs (GetInt16()), but the operands/base type areInt64. This will significantly reduce coverage and can hide sign/bit-pattern issues. UseTestLibrary.Generator.GetInt64()forNextValueOp1/2/3in the*_longcases.
src/tests/Common/GenerateHWIntrinsicTests/Arm/AdvSimdTests.cs:1 - The
*_longSha3 test cases generateInt16inputs (GetInt16()), but the operands/base type areInt64. This will significantly reduce coverage and can hide sign/bit-pattern issues. UseTestLibrary.Generator.GetInt64()forNextValueOp1/2/3in the*_longcases.
src/tests/Common/GenerateHWIntrinsicTests/Arm/AdvSimdTests.cs:1 Templates.VecBinOpTestis a binary-op template but this entry suppliesNextValueOp3. If the template doesn't expect anOp3key, this can cause confusion or template failures; if it ignores extra keys, it still makes this test definition misleading. RemoveNextValueOp3from this dictionary (or switch to a ternary-op template if three inputs are actually needed).
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi @a74nh the JIT changes + tests LGTM @tannergooding can you take a glance at the libraries/* changes here? It is mostly boilerplate |
dhartglassMSFT
commented
Jun 29, 2026
Pinging @tannergooding to look at some mostly boilerplate libs changes. |
Uh oh!
There was an error while loading. Please reload this page.
Fixes#98692
Fixes#94425