Skip to content

Commit

Permalink
Updating xarch to utilize EVEX compares and blending where profitable
Browse files Browse the repository at this point in the history
  • Loading branch information
tannergooding committed Dec 14, 2024
1 parent 2182002 commit 928fea3
Show file tree
Hide file tree
Showing 6 changed files with 840 additions and 210 deletions.
8 changes: 5 additions & 3 deletions src/coreclr/jit/gentree.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29540,7 +29540,7 @@ var_types GenTreeHWIntrinsic::GetLookupTypeForCmpOp(
{
case GT_EQ:
{
if (simdSize == 64)
if ((simdSize == 64) || (comp->opts.OptimizationEnabled() && comp->canUseEvexEncoding()))
{
lookupType = TYP_MASK;
}
Expand All @@ -29551,7 +29551,8 @@ var_types GenTreeHWIntrinsic::GetLookupTypeForCmpOp(
case GT_LE:
case GT_NE:
{
if ((simdSize == 64) || (varTypeIsIntegral(simdBaseType) && comp->canUseEvexEncoding()))
if ((simdSize == 64) ||
((comp->opts.OptimizationEnabled() || varTypeIsIntegral(simdBaseType)) && comp->canUseEvexEncoding()))
{
lookupType = TYP_MASK;
}
Expand All @@ -29561,7 +29562,8 @@ var_types GenTreeHWIntrinsic::GetLookupTypeForCmpOp(
case GT_GT:
case GT_LT:
{
if ((simdSize == 64) || (varTypeIsUnsigned(simdBaseType) && comp->canUseEvexEncoding()))
if ((simdSize == 64) ||
((comp->opts.OptimizationEnabled() || varTypeIsUnsigned(simdBaseType)) && comp->canUseEvexEncoding()))
{
lookupType = TYP_MASK;
}
Expand Down
11 changes: 5 additions & 6 deletions src/coreclr/jit/hwintrinsic.h
Original file line number Diff line number Diff line change
Expand Up @@ -546,12 +546,11 @@ struct HWIntrinsicInfo
static bool isScalarIsa(CORINFO_InstructionSet isa);

#ifdef TARGET_XARCH
static bool isAVX2GatherIntrinsic(NamedIntrinsic id);
static FloatComparisonMode lookupFloatComparisonModeForSwappedArgs(FloatComparisonMode comparison);
static NamedIntrinsic lookupIdForFloatComparisonMode(NamedIntrinsic intrinsic,
FloatComparisonMode comparison,
var_types simdBaseType,
unsigned simdSize);
static bool isAVX2GatherIntrinsic(NamedIntrinsic id);
static NamedIntrinsic lookupIdForFloatComparisonMode(NamedIntrinsic intrinsic,
FloatComparisonMode comparison,
var_types simdBaseType,
unsigned simdSize);
#endif

// Member lookup
Expand Down
Loading

0 comments on commit 928fea3

Please sign in to comment.