Fix SIMD intrinsics handling in crossgen2 (dotnet/coreclr#27853)
authorJan Vorlicek <janvorli@microsoft.com>
Wed, 13 Nov 2019 19:40:58 +0000 (20:40 +0100)
committerGitHub <noreply@github.com>
Wed, 13 Nov 2019 19:40:58 +0000 (20:40 +0100)
commit38928d62cda57532f7d3d6b27bd5bae3eca82e2c
tree142191d00e80a51da911fa95a3c7fa1f3dc6e10b
parent364b8d19d5bde823a32af3560b8154197b4487bc
Fix SIMD intrinsics handling in crossgen2 (dotnet/coreclr#27853)

* Fix SIMD intrinsics handling in crossgen2

Crossgen2 was compiling methods that call SIMD intrinsics
(System.Numerics.Vector<T>). This is not correct, as the size of the
vector is a runtime specific detail - e.g. when running on devices
without SSE2 support, the size is 4 and when running on devices with
SSE2 support, the size is 8.
This fixes runtime errors in 6 coreclr pri 0 tests.

* Reflect PR feedback

Create a IsVectorOfT method and use it at all places where we were
previously checking the namespace and type name of Vector<T>

Commit migrated from https://github.com/dotnet/coreclr/commit/0f9814cc4e25ee4060d8f3ae2305210aef94f1bc
src/coreclr/src/tools/crossgen2/Common/Compiler/VectorFieldLayoutAlgorithm.cs
src/coreclr/src/tools/crossgen2/Common/JitInterface/CorInfoImpl.cs
src/coreclr/src/tools/crossgen2/Common/JitInterface/SystemVStructClassificator.cs
src/coreclr/src/tools/crossgen2/ILCompiler.ReadyToRun/Compiler/ReadyToRunCompilerContext.cs