Skip to content
Merged
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
2 changes: 1 addition & 1 deletion src/coreclr/jit/hwintrinsic.cpp
Original file line number Diff line number Diff line change
@@ -1089,7 +1089,7 @@ NamedIntrinsic HWIntrinsicInfo::lookupId(Compiler* comp,
{
return NI_IsSupported_True;
}
else
else if (isSupportedProp)
{
assert(comp->IsTargetAbi(CORINFO_NATIVEAOT_ABI));
return NI_IsSupported_Dynamic;
19 changes: 11 additions & 8 deletions src/coreclr/tools/Common/InstructionSetHelpers.cs
Original file line number Diff line number Diff line change
@@ -198,21 +198,24 @@ public static InstructionSetSupport ConfigureInstructionSetSupport(string instru

// If AVX was enabled, we can opportunistically enable instruction sets which use the VEX encodings
Debug.Assert(InstructionSet.X64_AVX == InstructionSet.X86_AVX);
Debug.Assert(InstructionSet.X64_AVX2 == InstructionSet.X86_AVX2);
if (supportedInstructionSet.HasInstructionSet(InstructionSet.X64_AVX))
{
// TODO: Enable optimistic usage of AVX2 once we validate it doesn't break Vector<T> usage
// optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("avx2");

if (supportedInstructionSet.HasInstructionSet(InstructionSet.X64_AVX2))
{
optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("avxvnni");
}

optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("avx2");
optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("fma");
optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("bmi");
optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("bmi2");
optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("avxvnni");
optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("vpclmul");
optimisticInstructionSetSupportBuilder.AddSupportedInstructionSet("gfni_v256");

// If AVX2 is not in the supported set, we need to restrict the optimistic Vector<T> size, because
// 256-bit Vector<T> cannot be fully accelerated based on AVX2 being in the optimistic set only.

if (!supportedInstructionSet.HasInstructionSet(InstructionSet.X64_AVX2))
{
maxVectorTBitWidth = 128;
}
}

Debug.Assert(InstructionSet.X64_AVX512F == InstructionSet.X86_AVX512F);
32 changes: 30 additions & 2 deletions src/tests/nativeaot/SmokeTests/HardwareIntrinsics/Program.cs
Original file line number Diff line number Diff line change
@@ -114,11 +114,39 @@ static int Main()
bool? ExpectedSse42 = true;
bool? ExpectedPopcnt = null;
bool? ExpectedAvx = true;
bool? ExpectedAvx2 = false; // TODO: Fix once opportunistic Avx2 is allowed
bool? ExpectedAvx2 = null;
bool? ExpectedFma = null;
bool? ExpectedBmi1 = null;
bool? ExpectedBmi2 = null;
bool? ExpectedAvxVnni = false; // TODO: Fix once opportunistic Avx2 is allowed
bool? ExpectedAvxVnni = null;
bool? ExpectedAvx10v1 = false;
bool? ExpectedAvx10v1V512 = false;
bool? ExpectedAvx512F = false;
bool? ExpectedAvx512BW = false;
bool? ExpectedAvx512CD = false;
bool? ExpectedAvx512DQ = false;
bool? ExpectedAvx512Vbmi = false;
bool? ExpectedX86Serialize = null;
bool? ExpectedGfni = null;
bool? ExpectedGfniV256 = null;
bool? ExpectedGfniV512 = false;
#elif AVX_INTRINSICS_NO_AVX2
bool? ExpectedSse3 = true;
bool? ExpectedSsse3 = true;
bool? ExpectedAes = null;
bool? ExpectedLzcnt = null;
bool? ExpectedPclmulqdq = null;
bool? ExpectedPclmulqdqV256 = null;
bool? ExpectedPclmulqdqV512 = false;
bool? ExpectedSse41 = true;
bool? ExpectedSse42 = true;
bool? ExpectedPopcnt = null;
bool? ExpectedAvx = true;
bool? ExpectedAvx2 = false;
bool? ExpectedFma = null;
bool? ExpectedBmi1 = null;
bool? ExpectedBmi2 = null;
bool? ExpectedAvxVnni = false;
bool? ExpectedAvx10v1 = false;
bool? ExpectedAvx10v1V512 = false;
bool? ExpectedAvx512F = false;
Original file line number Diff line number Diff line change
@@ -8,7 +8,7 @@
<!-- Test infra issue on apple devices: https://github.com/dotnet/runtime/issues/89917 -->
<CLRTestTargetUnsupported Condition="'$(TargetsAppleMobile)' == 'true'">true</CLRTestTargetUnsupported>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<DefineConstants>$(DefineConstants);AVX_INTRINSICS;VECTORT128_INTRINSICS</DefineConstants>
<DefineConstants>$(DefineConstants);AVX_INTRINSICS_NO_AVX2;VECTORT128_INTRINSICS</DefineConstants>
<RequiresProcessIsolation>true</RequiresProcessIsolation>
<ReferenceXUnitWrapperGenerator>false</ReferenceXUnitWrapperGenerator>
</PropertyGroup>
Loading
Oops, something went wrong.