Skip to content

Conversation

@jkoritzinsky
Copy link
Member

We don't need to root the IsSupported getters for unsupported intrinsic types as the interpreter already handles those as return false;.

Add a new helper in InstructionSetParser to do the "instruction set -> types that provide hardware intrinsic methods for said instruction set" mapping so we don't need to search every type in the system module now that we only need to go through the explicitly supported instruction sets.

Adjust InstructionSetDesc.txt to support specifying the managed namespace for intrinsic instruction sets so we can better filter ISAs with no managed types (ie RiscV) and avoid hard-coding namespaces in LookupPlatformIntrinsicInstructionSet.

We don't need to root the IsSupported getters as the interpreter already handles those as `return false;`.

Add a new helper in InstructionSetParser to do the "instruction set -> types that provide hardware intrinsic methods for said instruction set" mapping so we don't need to search every type in the system module now that we only need to go through the explicitly supported instruction sets.
Document definearch command in instructionsetdesc.txt

Drive the "intrinsic namespace" logic for `LookupPlatformIntrinsicInstructionSet` from the newly added field in definearch.

 Fix the ARM64 intrinsics namespace.
Copy link
Contributor

Copilot AI left a comment

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 optimizes the hardware intrinsic rooting logic for interpreter-based platforms by only rooting methods from supported instruction sets rather than all hardware intrinsic types in the system module.

Key changes:

  • Added managed namespace parameter to architecture definitions in InstructionSetDesc.txt
  • Created new LookupPlatformIntrinsicTypes helper method to map instruction sets to their managed types
  • Updated ReadyToRunHardwareIntrinsicRootProvider to iterate only supported instruction sets

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetDesc.txt Added 6th parameter for managed namespace to definearch commands; fixed alignment and removed managed names for internal-only instruction sets like VectorT128 and RiscV64 ISAs
src/coreclr/tools/Common/JitInterface/ThunkGenerator/InstructionSetGenerator.cs Added _architectureManagedNamespace dictionary; updated definearch parsing to expect 6 parameters; generated new LookupPlatformIntrinsicTypes method with proper handling of nested types and 64-bit variants
src/coreclr/tools/Common/JitInterface/CorInfoInstructionSet.cs Generated code: added using System; updated ArchitectureToValidInstructionSets to remove incorrect R2R names; added X64 case to LookupPlatformIntrinsicInstructionSet; implemented new LookupPlatformIntrinsicTypes method
src/coreclr/tools/aot/ILCompiler.ReadyToRun/Compiler/ReadyToRunHardwareIntrinsicRootProvider.cs Replaced iteration over all system module types with efficient iteration over supported instruction sets using the new LookupPlatformIntrinsicTypes helper

@jkoritzinsky
Copy link
Member Author

/ba-g macos machines disconnected during CI run

@jkoritzinsky jkoritzinsky enabled auto-merge (squash) January 12, 2026 20:15
@jkoritzinsky jkoritzinsky merged commit a85b5f9 into dotnet:main Jan 12, 2026
104 of 108 checks passed
@github-project-automation github-project-automation bot moved this to Done in AppModel Jan 12, 2026
@jkoritzinsky jkoritzinsky deleted the hwintrinsics-only-supported branch January 12, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants