Skip to content
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
4 changes: 2 additions & 2 deletions src/coreclr/jit/hwintrinsic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ NamedIntrinsic HWIntrinsicInfo::lookupId(Compiler* comp,
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))
// on AVX1-only CPUs we only support a subset of intrinsics in Vector256
if (isLimitedVector256Isa && !AvxOnlyCompatible(ni))
{
return NI_Illegal;
}
Expand Down
14 changes: 13 additions & 1 deletion src/coreclr/jit/hwintrinsic.h
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,11 @@ enum HWIntrinsicFlag : unsigned int
// Returns Per-Element Mask
// the intrinsic returns a vector containing elements that are either "all bits set" or "all bits clear"
// this output can be used as a per-element mask
HW_Flag_ReturnsPerElementMask = 0x20000
HW_Flag_ReturnsPerElementMask = 0x20000,

// AvxOnlyCompatible
// the intrinsic can be used on hardware with AVX but not AVX2 support
HW_Flag_AvxOnlyCompatible = 0x40000,

#elif defined(TARGET_ARM64)
// The intrinsic has an immediate operand
Expand Down Expand Up @@ -658,6 +662,14 @@ struct HWIntrinsicInfo
#endif
}

#if defined(TARGET_XARCH)
static bool AvxOnlyCompatible(NamedIntrinsic id)
{
HWIntrinsicFlag flags = lookupFlags(id);
return (flags & HW_Flag_AvxOnlyCompatible) != 0;
}
#endif

static bool BaseTypeFromFirstArg(NamedIntrinsic id)
{
HWIntrinsicFlag flags = lookupFlags(id);
Expand Down
Loading