Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable NI_Vector256_Create on AVX1 #72522

Merged
merged 4 commits into from
Jul 25, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions src/coreclr/jit/hwintrinsic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,9 @@ NamedIntrinsic HWIntrinsicInfo::lookupId(Compiler* comp,
// ISA is unsupported. For Vector256 this is when AVX2 is unsupported since integer types
// can't get properly accelerated.

// We support some Vector256 intrinsics on AVX-only CPUs
bool isLimitedVector256Isa = false;

if (isa == InstructionSet_Vector128)
{
if (!comp->IsBaselineSimdIsaSupported())
Expand All @@ -331,7 +334,14 @@ NamedIntrinsic HWIntrinsicInfo::lookupId(Compiler* comp,
{
if (!comp->compOpportunisticallyDependsOn(InstructionSet_AVX2))
{
return NI_Illegal;
if (comp->compOpportunisticallyDependsOn(InstructionSet_AVX))
{
isLimitedVector256Isa = true;
}
else
{
return NI_Illegal;
}
}
}
#elif defined(TARGET_ARM64)
Expand Down Expand Up @@ -362,7 +372,16 @@ NamedIntrinsic HWIntrinsicInfo::lookupId(Compiler* comp,

if (strcmp(methodName, intrinsicInfo.name) == 0)
{
return intrinsicInfo.id;
NamedIntrinsic ni = intrinsicInfo.id;

#if defined(TARGET_XARCH)
// on AVX1-only CPUs we only support NI_Vector256_Create intrinsic in Vector256
if (isLimitedVector256Isa && (ni != NI_Vector256_Create))
{
return NI_Illegal;
}
#endif
return ni;
}
}

Expand Down
Loading