I\'m running some C# code that uses System.Numerics.Vector
but as far as I can tell I\'m not getting the full benefit of SIMD intrinsics. I\'m using Visual
Your processor is a bit dated, its micro-architecture is Ivy Bridge. The "tock" of Sandy Bridge, a feature shrink without architectural changes. Your nemesis is this bit of code in RyuJIT, located in ee_il_dll.cpp, CILJit::getMaxIntrinsicSIMDVectorLength() function:
if (((cpuCompileFlags & CORJIT_FLG_PREJIT) == 0) &&
((cpuCompileFlags & CORJIT_FLG_FEATURE_SIMD) != 0) &&
((cpuCompileFlags & CORJIT_FLG_USE_AVX2) != 0))
{
static ConfigDWORD fEnableAVX;
if (fEnableAVX.val(CLRConfig::EXTERNAL_EnableAVX) != 0)
{
return 32;
}
}
Note the use of CORJIT_FLG_USE_AVX2. Your processor does not support AVX2 yet, that extension became available in Haswell. The next micro-architecture after Ivy Bridge, a "tick". Very nice processor btw, discoveries like this one have a major wow factor.
Nothing you can do about this but go shopping. For inspiration, you can look at the kind of code it generates in this post.