Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

Commit adbfd2c

Browse files
sdmacleajkotas
authored andcommitted
[Arm64] Disable HW Intrinsic NGEN (#15603)
1 parent 4815ea5 commit adbfd2c

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/vm/methodtablebuilder.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1484,20 +1484,25 @@ MethodTableBuilder::BuildMethodTableThrowing(
14841484
}
14851485
}
14861486

1487-
#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_)
1488-
// All the funtions in System.Runtime.Intrinsics.X86 are hardware intrinsics.
1489-
// We specially treat them here to reduce the disk footprint of mscorlib.
1487+
#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
14901488
if (GetModule()->IsSystem() && !bmtGenerics->HasInstantiation())
14911489
{
1492-
LPCUTF8 x86className;
1493-
LPCUTF8 x86nameSpace;
1494-
HRESULT hr = GetMDImport()->GetNameOfTypeDef(bmtInternal->pType->GetTypeDefToken(), &x86className, &x86nameSpace);
1490+
LPCUTF8 className;
1491+
LPCUTF8 nameSpace;
1492+
HRESULT hr = GetMDImport()->GetNameOfTypeDef(bmtInternal->pType->GetTypeDefToken(), &className, &nameSpace);
14951493

1496-
if (hr == S_OK && strcmp(x86nameSpace, "System.Runtime.Intrinsics.X86") == 0)
1494+
#if defined(_TARGET_ARM64_)
1495+
// All the funtions in System.Runtime.Intrinsics.Arm.Arm64 are hardware intrinsics.
1496+
if (hr == S_OK && strcmp(nameSpace, "System.Runtime.Intrinsics.Arm.Arm64") == 0)
1497+
#else
1498+
// All the funtions in System.Runtime.Intrinsics.X86 are hardware intrinsics.
1499+
if (hr == S_OK && strcmp(nameSpace, "System.Runtime.Intrinsics.X86") == 0)
1500+
#endif
14971501
{
14981502
if (IsCompilationProcess())
14991503
{
15001504
// Disable AOT compiling for managed implementation of hardware intrinsics in mscorlib.
1505+
// We specially treat them here to ensure correct ISA features are set during compilation
15011506
COMPlusThrow(kTypeLoadException, IDS_EE_HWINTRINSIC_NGEN_DISALLOWED);
15021507
}
15031508
bmtProp->fIsHardwareIntrinsic = true;

0 commit comments

Comments
 (0)