summaryrefslogtreecommitdiff
path: root/src/jit/gentree.cpp
diff options
context:
space:
mode:
authorTanner Gooding <tagoo@outlook.com>2018-12-21 07:45:24 -0800
committerGitHub <noreply@github.com>2018-12-21 07:45:24 -0800
commit63ab188ccae6cc1b0c65103db7f453833e2c19a8 (patch)
tree38c22d6d58064beb7f341b79311188413b8fb597 /src/jit/gentree.cpp
parent3621170acc989339c4ea2ba78babb9576913837e (diff)
downloadcoreclr-63ab188ccae6cc1b0c65103db7f453833e2c19a8.tar.gz
coreclr-63ab188ccae6cc1b0c65103db7f453833e2c19a8.tar.bz2
coreclr-63ab188ccae6cc1b0c65103db7f453833e2c19a8.zip
Updating gtGetSIMDZero to only return the NI_Base_VectorXXX_Zero node if they are supported by the compiler (#21605)
Diffstat (limited to 'src/jit/gentree.cpp')
-rw-r--r--src/jit/gentree.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/jit/gentree.cpp b/src/jit/gentree.cpp
index 59a4fc8a7e..f6b6dc8107 100644
--- a/src/jit/gentree.cpp
+++ b/src/jit/gentree.cpp
@@ -16449,9 +16449,23 @@ GenTree* Compiler::gtGetSIMDZero(var_types simdType, var_types baseType, CORINFO
switch (simdType)
{
case TYP_SIMD16:
- return gtNewSimdHWIntrinsicNode(simdType, NI_Base_Vector128_Zero, baseType, size);
+ if (compSupports(InstructionSet_SSE))
+ {
+ // We only return the HWIntrinsicNode if SSE is supported, since it is possible for
+ // the user to disable the SSE HWIntrinsic support via the COMPlus configuration knobs
+ // even though the hardware vector types are still available.
+ return gtNewSimdHWIntrinsicNode(simdType, NI_Base_Vector128_Zero, baseType, size);
+ }
+ return nullptr;
case TYP_SIMD32:
- return gtNewSimdHWIntrinsicNode(simdType, NI_Base_Vector256_Zero, baseType, size);
+ if (compSupports(InstructionSet_AVX))
+ {
+ // We only return the HWIntrinsicNode if AVX is supported, since it is possible for
+ // the user to disable the AVX HWIntrinsic support via the COMPlus configuration knobs
+ // even though the hardware vector types are still available.
+ return gtNewSimdHWIntrinsicNode(simdType, NI_Base_Vector256_Zero, baseType, size);
+ }
+ return nullptr;
default:
break;
}