Skip to content

Commit

Permalink
Fix GetHardwareIntrinsicId on 32bit platforms (#110238)
Browse files Browse the repository at this point in the history
AFAIK methods on the nested X64/Arm64 classes shouldn't be considered intrinsics on 32bit platforms since they are as relevant as e.g. WASM intrinsics. This should fix widespread runtime-nativeaot-outerloop failure on x86. I think this regressed in #109137.
  • Loading branch information
MichalStrehovsky authored Dec 3, 2024
1 parent 758bbc6 commit 12afded
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/coreclr/tools/Common/Compiler/InstructionSetSupport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,13 @@ public static string GetHardwareIntrinsicId(TargetArchitecture architecture, Typ
return "";

// 64-bit ISA variants are not included in the mapping dictionary, so we use the containing type instead
if ((architecture, potentialType.Name) is (TargetArchitecture.X64, "X64") or (TargetArchitecture.ARM64, "Arm64"))
potentialType = (MetadataType)potentialType.ContainingType;
if (potentialType.Name is "X64" or "Arm64")
{
if (architecture is TargetArchitecture.X64 or TargetArchitecture.ARM64)
potentialType = (MetadataType)potentialType.ContainingType;
else
return "";
}

// We assume that managed names in InstructionSetDesc.txt use an underscore separator for nested classes
string suffix = "";
Expand Down

0 comments on commit 12afded

Please sign in to comment.