Skip to content

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 (dotnet/coreclr#21605)

Commit migrated from dotnet/coreclr@63ab188
  • Loading branch information
tannergooding authored Dec 21, 2018
1 parent fa49bd7 commit d88dba0
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/coreclr/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 d88dba0

Please sign in to comment.