Skip to content

Add Sm4 and SVE Sm4 APIs#130039

Open
a74nh wants to merge 9 commits into
dotnet:mainfrom
a74nh:sm4_github
Open

Add Sm4 and SVE Sm4 APIs#130039
a74nh wants to merge 9 commits into
dotnet:mainfrom
a74nh:sm4_github

Conversation

@a74nh

@a74nh a74nh commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Fixes #94426
Fixes #98696

Copilot AI review requested due to automatic review settings June 30, 2026 15:34
@dotnet-policy-service dotnet-policy-service Bot added linkable-framework Issues associated with delivering a linker friendly framework community-contribution Indicates that the PR has been added by a community member labels Jun 30, 2026
@a74nh a74nh mentioned this pull request Jun 30, 2026
20 tasks

Copilot AI 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.

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.Sm4 and System.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

Comment thread src/coreclr/jit/hwintrinsiccodegenarm64.cpp Outdated
Comment thread src/tests/JIT/HardwareIntrinsics/Arm/Shared/Helpers.cs Outdated
Comment thread src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs Outdated
Comment thread src/libraries/System.Runtime.Intrinsics/ref/System.Runtime.Intrinsics.cs Outdated
@a74nh

a74nh commented Jul 1, 2026

Copy link
Copy Markdown
Contributor Author

@dhartglassMSFT : Next set is ready for review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-System.Runtime.Intrinsics community-contribution Indicates that the PR has been added by a community member linkable-framework Issues associated with delivering a linker friendly framework

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[API Proposal]: Arm64: FEAT_SM4 [API Proposal]: Arm64: FEAT_SVE_SM4

2 participants