[Arm64] Disable HW Intrinsic NGEN (#15603)
authorSteve MacLean <sdmaclea.qdt@qualcommdatacenter.com>
Sat, 23 Dec 2017 00:54:35 +0000 (19:54 -0500)
committerJan Kotas <jkotas@microsoft.com>
Sat, 23 Dec 2017 00:54:35 +0000 (16:54 -0800)
src/vm/methodtablebuilder.cpp

index b9f7e84926283219c44d421332f21917e849674a..c13e220e8d501f87cbbf9a404629bffeef61ab9f 100644 (file)
@@ -1484,20 +1484,25 @@ MethodTableBuilder::BuildMethodTableThrowing(
         }
     }
 
-#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_) 
-    // All the funtions in System.Runtime.Intrinsics.X86 are hardware intrinsics.
-    // We specially treat them here to reduce the disk footprint of mscorlib.
+#if defined(_TARGET_X86_) || defined(_TARGET_AMD64_) || defined(_TARGET_ARM64_)
     if (GetModule()->IsSystem() && !bmtGenerics->HasInstantiation())
     {
-        LPCUTF8 x86className;
-        LPCUTF8 x86nameSpace;
-        HRESULT hr = GetMDImport()->GetNameOfTypeDef(bmtInternal->pType->GetTypeDefToken(), &x86className, &x86nameSpace);
+        LPCUTF8 className;
+        LPCUTF8 nameSpace;
+        HRESULT hr = GetMDImport()->GetNameOfTypeDef(bmtInternal->pType->GetTypeDefToken(), &className, &nameSpace);
     
-        if (hr == S_OK && strcmp(x86nameSpace, "System.Runtime.Intrinsics.X86") == 0)
+#if defined(_TARGET_ARM64_)
+        // All the funtions in System.Runtime.Intrinsics.Arm.Arm64 are hardware intrinsics.
+        if (hr == S_OK && strcmp(nameSpace, "System.Runtime.Intrinsics.Arm.Arm64") == 0)
+#else
+        // All the funtions in System.Runtime.Intrinsics.X86 are hardware intrinsics.
+        if (hr == S_OK && strcmp(nameSpace, "System.Runtime.Intrinsics.X86") == 0)
+#endif
         {
             if (IsCompilationProcess())
             {
                 // Disable AOT compiling for managed implementation of hardware intrinsics in mscorlib.
+                // We specially treat them here to ensure correct ISA features are set during compilation
                 COMPlusThrow(kTypeLoadException, IDS_EE_HWINTRINSIC_NGEN_DISALLOWED);
             }
             bmtProp->fIsHardwareIntrinsic = true;