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

Commit 4414879

Browse files
committed
Stop the SIMD hardware intrinsics types from undergoing crossgen.
1 parent 34776bf commit 4414879

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/vm/methodtablebuilder.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1499,7 +1499,21 @@ MethodTableBuilder::BuildMethodTableThrowing(
14991499
LPCUTF8 className;
15001500
LPCUTF8 nameSpace;
15011501
HRESULT hr = GetMDImport()->GetNameOfTypeDef(bmtInternal->pType->GetTypeDefToken(), &className, &nameSpace);
1502-
1502+
1503+
if (hr == S_OK && strcmp(nameSpace, "System.Runtime.Intrinsics") == 0)
1504+
{
1505+
if (IsCompilationProcess())
1506+
{
1507+
// Disable AOT compiling for the SIMD hardware intrinsic types. These types require special
1508+
// ABI handling as they represent fundamental data types (__m64, __m128, and __m256) and not
1509+
// aggregate or union types. See https://github.com/dotnet/coreclr/issues/15943
1510+
//
1511+
// Once they are properly handled according to the ABI requirements, we can remove this check
1512+
// and allow them to be used in crossgen/AOT scenarios.
1513+
COMPlusThrow(kTypeLoadException, IDS_EE_HWINTRINSIC_NGEN_DISALLOWED);
1514+
}
1515+
}
1516+
15031517
#if defined(_TARGET_ARM64_)
15041518
// All the funtions in System.Runtime.Intrinsics.Arm.Arm64 are hardware intrinsics.
15051519
if (hr == S_OK && strcmp(nameSpace, "System.Runtime.Intrinsics.Arm.Arm64") == 0)

0 commit comments

Comments
 (0)