Skip to content

Commit 12afded

Browse files
Fix GetHardwareIntrinsicId on 32bit platforms (#110238)
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.
1 parent 758bbc6 commit 12afded

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/coreclr/tools/Common/Compiler/InstructionSetSupport.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,13 @@ public static string GetHardwareIntrinsicId(TargetArchitecture architecture, Typ
7171
return "";
7272

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

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

0 commit comments

Comments
 (0)