Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.

Commit

Permalink
Updating gtGetSIMDZero to only return the NI_Base_VectorXXX_Zero node…
Browse files Browse the repository at this point in the history
… if they are supported by the compiler (#21605)
  • Loading branch information
tannergooding authored Dec 21, 2018
1 parent 3621170 commit 63ab188
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 63ab188

Please sign in to comment.