Skip to content

Add InstructionSet_VectorT for ARM64#123992

Merged
tannergooding merged 8 commits intodotnet:mainfrom
snickolls-arm:vectort-isa
Feb 17, 2026
Merged

Add InstructionSet_VectorT for ARM64#123992
tannergooding merged 8 commits intodotnet:mainfrom
snickolls-arm:vectort-isa

Conversation

@snickolls-arm
Copy link
Contributor

Adds boilerplate code for an InstructionSet definition for the Vector<T> API surface, as we'll be needing an abstraction layer to redirect it to AdvSimd/SVE as appropriate for the target.

@github-actions github-actions bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Feb 4, 2026
@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Feb 4, 2026
@snickolls-arm
Copy link
Contributor Author

@dotnet/arm64-contrib

@dotnet-policy-service
Copy link
Contributor

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

* Fix issues in InstructionSetDesc.txt
* Prevent VectorT ISA from being enabled at the same time as VectorT128
* Add DOTNET_JitUseScalableVectorT to EE
* Only enable VectorT ISA when DOTNET_JitUseScalableVectorT=1
@snickolls-arm
Copy link
Contributor Author

The test failures look unrelated, this is ready for another review.

@tannergooding tannergooding enabled auto-merge (squash) February 9, 2026 20:43
@stephentoub
Copy link
Member

Code Review: PR #123992 - Add InstructionSet_VectorT for ARM64

Holistic Assessment

Motivation: Adding boilerplate for InstructionSet_VectorT to enable future Vector<T> redirection to SVE on ARM64.

Approach: Adds a new instruction set definition following the established patterns in the JIT infrastructure. The change correctly uses the instruction set generation system (InstructionSetDesc.txt) and manually updates related files to stay in sync.

Net Positive: ✅ This is foundational plumbing work needed for future SVE-based Vector<T> support. The approach is sound.


Detailed Findings

⚠️ Design Consideration: DEBUG-only in Release VM Code

Files: src/coreclr/vm/codeman.cpp:1444-1452, src/coreclr/jit/compiler.cpp:5918-5927

The config value JitUseScalableVectorT is defined as CONFIG_DWORD_INFO (DEBUG-only) in clrconfigvalues.h, and the runtime code reads it only under #ifdef _DEBUG / #ifdef DEBUG.

However, the config definition uses EXTERNAL_ prefix which typically indicates a retail-accessible config. The mismatch is intentional here (experimental feature), but consider:

  1. Documenting this is intentionally DEBUG-only for now
  2. Or rename to INTERNAL_JitUseScalableVectorT to make the DEBUG-only intent clearer

✅ Correct Enum Ordering

The new InstructionSet_VectorT=12 is inserted between Vector128 and Dczva, which renumbers subsequent enums. This is correctly synchronized across:

  • corinfoinstructionset.h
  • CorInfoInstructionSet.cs
  • hwintrinsic.cpp array entries

✅ JIT-EE GUID Updated

The JITEEVersionIdentifier GUID is correctly updated in jiteeversionguid.h, which is required when instruction set enums change.

✅ Implication Chain Correct

The InstructionSetDesc.txt correctly declares:

  • vectorinstructionset,ARM64,VectorT - marks it as a vector ISA
  • implication,ARM64,VectorT,Sve - VectorT implies SVE support

The generated code in CorInfoInstructionSet.cs correctly propagates these implications in both forward and reverse directions.

✅ ReadyToRun Handling

ReadyToRunInstructionSetHelper.cs returns null for ARM64_VectorT, which is correct - this is a JIT-only concept not persisted in R2R images.

💡 Suggestion: Consider Ordering in InstructionSetDesc.txt

In the PR diff, VectorT is added after Vector128 but the implication line is added after Vector128 implication. This is fine, but for better grouping, consider placing VectorT-related entries near VectorT128 since they are conceptually related (both are Vector<T> implementations).


Test Coverage

This PR adds infrastructure only with no behavioral changes in non-DEBUG builds. The DEBUG-only code paths are gated behind a config switch that defaults to off. Future PRs implementing actual Vector<T> SVE support should include tests.


Summary

Verdict: ✅ Approve

This is clean infrastructure work that follows established patterns in the codebase. The changes are correctly synchronized across all the instruction set definition files. The DEBUG-only gating is appropriate for experimental features.

Minor suggestion: Consider using INTERNAL_ prefix instead of EXTERNAL_ for the config value to make the DEBUG-only nature more explicit in the naming.

@snickolls-arm
Copy link
Contributor Author

@tannergooding I think these test failures are unrelated, but I've disabled your auto-merge responding to Stephen's comment.

@tannergooding
Copy link
Member

/ba-g unrelated http timeout

@tannergooding tannergooding merged commit 11edfaf into dotnet:main Feb 17, 2026
114 of 116 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI community-contribution Indicates that the PR has been added by a community member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants