Adding basic support for recognizing and handling SIMD intrinsics as HW intrinsics...
authorTanner Gooding <tagoo@outlook.com>
Tue, 5 May 2020 00:01:36 +0000 (17:01 -0700)
committerGitHub <noreply@github.com>
Tue, 5 May 2020 00:01:36 +0000 (17:01 -0700)
commit56518a7546bf2ad200936938e0f33cd07d54a378
treec711f75f12aef87823d2e30be54e82b88fcbf506
parent2b3de4f14f879ed7005e5c748d5f3e2a6d553b6e
Adding basic support for recognizing and handling SIMD intrinsics as HW intrinsics (#35421)

* Adding basic support for recognizing and handling SIMD intrinsics as HW intrinsics

* Applying formatting patch

* Fixing a preprocessor concatenation for non windows

* Add a default case to workaround a compiler warning on FreeBSD

* Fixing a noway_assert to include GT_HWINTRINSIC

* Fixing some asserts that were being triggered

* Use getSIMDVectorRegisterByteLength

* Applying formatting patch

* Fixing ARM64 to use the actual type size

* Removing the [Intrinsic] attribute from some Vector2/3/4 methods which aren't intrinsic

* Updating SSE/SSE2 CompareGreaterThan and related functions to be table driven

* Fixing the SimdAsHWIntrinsic relational operations to match the GT_SIMD behavior

* Ensure that GT_HWINTRINSIC fixes the type for certain TYP_SIMD8

* Fixing the SimdAsHWIntrinsic Vector<int>.op_Multiply support to match the GT_SIMD behavior

* Fixing the SimdAsHWIntrinsic Vector2/3 Division to match the GT_SIMD behavior

* Porting Abs, Min, and Max to use the SimdAsHWIntrinsic support

* Minor fixups to the SSE2 codepath

* Applying formatting patch

* Fixing a check in lowering

* Mark SimdAsHWIntrinsic nodes so we can lookup the correct handle

* Adding the 3 operand overload for gtNewSimdAsHWIntrinsicNode

* Fixing BuildHWIntrinsic to properly take RMW into account

* Fixing the rationalize handling of GT_HWINTRINSIC to account for SIMD vs non-SIMD nodes

* Fixing the importer to not create SIMD nodes if featureSIMD is disabled

* Fixing the SSE4.2 implementation of CompareLessThan<long>

* Preserve the base type for subtraction/addition operations

* Applying formatting patch

* Responding to PR feedback

* Fixing a copy/paste error under reinterpret cast

* Fixing abs to expect 1 argument

* Adding method comment headers that were missing

* Removing unused table entries from SimdAsHWIntrinsic for Vector2/3/4

* Ensure we catch intrinsics from the Vector static class

* Fixing SSSE3_Abs and AVX2_Abs to get the base type from the first argument

* Ensure we adjust the class handle used for intrinsics from the Vector static class

* Ensure we populate the handle cache for clsHnd even if it isn't used

* Fix where we grab the base type from for the static Vector class

* Fixing ConditionalSelect and improving the messages used for impCloneExpr in SimdAsHWIntrinsic

* Ensure we clone the constVectorDup before using it

* Applying formatting patch
26 files changed:
src/coreclr/src/jit/CMakeLists.txt
src/coreclr/src/jit/compiler.h
src/coreclr/src/jit/flowgraph.cpp
src/coreclr/src/jit/gentree.cpp
src/coreclr/src/jit/gentree.h
src/coreclr/src/jit/hwintrinsic.cpp
src/coreclr/src/jit/hwintrinsic.h
src/coreclr/src/jit/hwintrinsiccodegenarm64.cpp
src/coreclr/src/jit/hwintrinsiccodegenxarch.cpp
src/coreclr/src/jit/hwintrinsiclistxarch.h
src/coreclr/src/jit/hwintrinsicxarch.cpp
src/coreclr/src/jit/importer.cpp
src/coreclr/src/jit/lower.cpp
src/coreclr/src/jit/lowerarmarch.cpp
src/coreclr/src/jit/lowerxarch.cpp
src/coreclr/src/jit/lsraxarch.cpp
src/coreclr/src/jit/namedintrinsiclist.h
src/coreclr/src/jit/rationalize.cpp
src/coreclr/src/jit/simd.cpp
src/coreclr/src/jit/simdashwintrinsic.cpp [new file with mode: 0644]
src/coreclr/src/jit/simdashwintrinsic.h [new file with mode: 0644]
src/coreclr/src/jit/simdashwintrinsiclistarm64.h [new file with mode: 0644]
src/coreclr/src/jit/simdashwintrinsiclistxarch.h [new file with mode: 0644]
src/libraries/System.Private.CoreLib/src/System/Numerics/Vector2_Intrinsics.cs
src/libraries/System.Private.CoreLib/src/System/Numerics/Vector3_Intrinsics.cs
src/libraries/System.Private.CoreLib/src/System/Numerics/Vector4_Intrinsics.cs