From 56af6463587132afc44a2ed6a2383caee8bca4ca Mon Sep 17 00:00:00 2001 From: Egor Chesakov Date: Wed, 5 Aug 2020 19:31:15 -0700 Subject: [PATCH 1/2] Treat non-generic methods of Vector64 and Vector128 as intrinsics in zapinfo.cpp --- src/coreclr/src/zap/zapinfo.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/zap/zapinfo.cpp b/src/coreclr/src/zap/zapinfo.cpp index e997efa396b1e..e8649fc101842 100644 --- a/src/coreclr/src/zap/zapinfo.cpp +++ b/src/coreclr/src/zap/zapinfo.cpp @@ -2171,8 +2171,10 @@ DWORD FilterNamedIntrinsicMethodAttribs(ZapInfo* pZapInfo, DWORD attribs, CORINF fTreatAsRegularMethodCall = fIsGetIsSupportedMethod && fIsPlatformHWIntrinsic; #if defined(TARGET_ARM64) - // On Arm64 AdvSimd ISA is required by CoreCLR, so we can expand Vector64 and Vector128 methods. - fTreatAsRegularMethodCall |= !fIsPlatformHWIntrinsic && fIsHWIntrinsic && (strcmp(className, "Vector64`1") != 0) && (strcmp(className, "Vector128`1") != 0); + // On Arm64 AdvSimd ISA is required by CoreCLR, so we can expand Vector64 and Vector128 generic methods (e.g. Vector64.get_Zero) + // as well as Vector64 and Vector128 methods (e.g. Vector128.CreateScalarUnsafe). + fTreatAsRegularMethodCall |= !fIsPlatformHWIntrinsic && fIsHWIntrinsic + && (strstr(className, "Vector64") != className) && (strstr(className, "Vector128") != className); #else fTreatAsRegularMethodCall |= !fIsPlatformHWIntrinsic && fIsHWIntrinsic; #endif From 29e0e1a1fcf62f0389d10e22ac66842ea572ff37 Mon Sep 17 00:00:00 2001 From: Egor Chesakov Date: Fri, 7 Aug 2020 11:37:16 -0700 Subject: [PATCH 2/2] Use strncmp for computing `className startswith "Vector64"` and `className startswith "Vector128"` in zapinfo.cpp --- src/coreclr/src/zap/zapinfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/coreclr/src/zap/zapinfo.cpp b/src/coreclr/src/zap/zapinfo.cpp index e8649fc101842..ff12d9631621d 100644 --- a/src/coreclr/src/zap/zapinfo.cpp +++ b/src/coreclr/src/zap/zapinfo.cpp @@ -2174,7 +2174,8 @@ DWORD FilterNamedIntrinsicMethodAttribs(ZapInfo* pZapInfo, DWORD attribs, CORINF // On Arm64 AdvSimd ISA is required by CoreCLR, so we can expand Vector64 and Vector128 generic methods (e.g. Vector64.get_Zero) // as well as Vector64 and Vector128 methods (e.g. Vector128.CreateScalarUnsafe). fTreatAsRegularMethodCall |= !fIsPlatformHWIntrinsic && fIsHWIntrinsic - && (strstr(className, "Vector64") != className) && (strstr(className, "Vector128") != className); + && (strncmp(className, "Vector64", _countof("Vector64") - 1) != 0) + && (strncmp(className, "Vector128", _countof("Vector128") - 1) != 0); #else fTreatAsRegularMethodCall |= !fIsPlatformHWIntrinsic && fIsHWIntrinsic; #endif