Add Sm4 and SVE Sm4 APIs#130039
Open
a74nh wants to merge 9 commits into
Open
Conversation
Fixes dotnet#94426 Fixes dotnet#98696
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds new Arm64 hardware intrinsic APIs for SM4 (FEAT_SM4) and SVE SM4 (FEAT_SVE_SM4), wires them up through the JIT hardware intrinsic tables/codegen, and adds corresponding JIT HardwareIntrinsics test coverage (including generator input updates and shared helper validation code).
Changes:
- Introduces new public intrinsics surface for
System.Runtime.Intrinsics.Arm.Sm4andSystem.Runtime.Intrinsics.Arm.SveSm4(ref + CoreLib) and updates linker substitutions. - Adds JIT intrinsic definitions for Sm4/SveSm4 and updates Arm64 codegen/emitter handling.
- Adds/updates JIT HWIntrinsic tests and generator inputs for Sm4/SveSm4.
Reviewed changes
Copilot reviewed 23 out of 23 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| src/tests/JIT/HardwareIntrinsics/Arm/SveSm4/SveSm4_ro.csproj | New optimized (ro) test project for SveSm4 |
| src/tests/JIT/HardwareIntrinsics/Arm/SveSm4/SveSm4_r.csproj | New non-optimized (r) test project for SveSm4 |
| src/tests/JIT/HardwareIntrinsics/Arm/SveSm4/Program.SveSm4.cs | Test harness partial Program for SveSm4 |
| src/tests/JIT/HardwareIntrinsics/Arm/Sm4/Sm4_ro.csproj | New optimized (ro) test project for Sm4 |
| src/tests/JIT/HardwareIntrinsics/Arm/Sm4/Sm4_r.csproj | New non-optimized (r) test project for Sm4 |
| src/tests/JIT/HardwareIntrinsics/Arm/Sm4/Program.Sm4.cs | Test harness partial Program for Sm4 |
| src/tests/JIT/HardwareIntrinsics/Arm/Shared/Program.cs | Prints Sha3, Sm4, and SveSm4 support in test output |
| src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs | Adds SM4 reference helpers for result validation in tests |
| src/tests/Common/GenerateHWIntrinsicTests/GenerateHWIntrinsicTests_Arm.cs | Adds Sm4/SveSm4 generator input groups to processing |
| src/tests/Common/GenerateHWIntrinsicTests/Arm/SveTests.cs | Adds SveSm4Inputs generator definitions |
| src/tests/Common/GenerateHWIntrinsicTests/Arm/AdvSimdTests.cs | Adds Sm4Inputs generator definitions |
| src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs | Adds new public ref surface for Sm4 and SveSm4 |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sm4.cs | CoreLib implementation stub for Sm4 intrinsics |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/Sm4.PlatformNotSupported.cs | PlatformNotSupported implementation for Sm4 |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/SveSm4.cs | CoreLib implementation stub for SveSm4 intrinsics |
| src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Arm/SveSm4.PlatformNotSupported.cs | PlatformNotSupported implementation for SveSm4 |
| src/libraries/System.Private.CoreLib/src/System.Private.CoreLib.Shared.projitems | Adds Sm4/SveSm4 compile items (and reorders nearby entries) |
| src/libraries/System.Private.CoreLib/src/ILLink/ILLink.Substitutions.NoArmIntrinsics.xml | Stubs IsSupported for Sm4/SveSm4 when Arm intrinsics are excluded |
| src/coreclr/jit/hwintrinsiclistarm64sve.h | Adds SveSm4 intrinsics (Encode/KeyUpdate) |
| src/coreclr/jit/hwintrinsiclistarm64.h | Adds Sm4 intrinsics (Encode/KeyUpdate) |
| src/coreclr/jit/hwintrinsiccodegenarm64.cpp | Updates Arm64 HWIntrinsic emission logic for RMW 2-operand intrinsics |
| src/coreclr/jit/hwintrinsic.cpp | Enables ISA ranges for Sm4 and SveSm4 |
| src/coreclr/jit/emitarm64.cpp | Adds INS_sm4e to RMW emission handling in the 3-reg emitter helper |
3 tasks
Change-Id: Icd79648d7bfb6efb2c1695ade6920e95b13fa51e
Contributor
Author
|
@dhartglassMSFT : Next set is ready for review |
This was referenced Jul 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #94426
Fixes #98696