1
0
Fork 0
mirror of https://github.com/VSadov/Satori.git synced 2025-06-09 17:44:48 +09:00

Don't notify crossgen2 about Vector<T> size when not needed (#34614)

- Stop notifying  about usage status of AVX2 when using isSubRegisterSIMDType
- This allows use of the Vector2/3/4 simd types in crossgen'd code without fixing whether or not Avx2 is required
This commit is contained in:
David Wrighton 2020-04-30 10:17:12 -07:00 committed by GitHub
parent aa81328f4e
commit 71f84aa8d7
Signed by: github
GPG key ID: 4AEE18F83AFDEB23

View file

@ -8087,7 +8087,25 @@ private:
// AVX: vector2f, 3f and 4f are all considered sub register SIMD types.
bool isSubRegisterSIMDType(GenTreeSIMD* simdNode)
{
return (simdNode->gtSIMDSize < getSIMDVectorRegisterByteLength());
unsigned vectorRegisterByteLength;
#if defined(TARGET_XARCH)
// Calling the getSIMDVectorRegisterByteLength api causes the size of Vector<T> to be recorded
// with the AOT compiler, so that it cannot change from aot compilation time to runtime
// This api does not require such fixing as it merely pertains to the size of the simd type
// relative to the Vector<T> size as used at compile time. (So detecting a vector length of 16 here
// does not preclude the code from being used on a machine with a larger vector length.)
if (getSIMDSupportLevel() < SIMD_AVX2_Supported)
{
vectorRegisterByteLength = 16;
}
else
{
vectorRegisterByteLength = 32;
}
#else
vectorRegisterByteLength = getSIMDVectorRegisterByteLength();
#endif
return (simdNode->gtSIMDSize < vectorRegisterByteLength);
}
// Get the type for the hardware SIMD vector.