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

Add VPCLMULQDQ intrinsics #109137

Merged
merged 20 commits into from
Nov 20, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix AOT instruction sets
  • Loading branch information
saucecontrol committed Nov 5, 2024
commit 05bea1c86d5cdda5bfdc8c00e214acba68511ce6
6 changes: 1 addition & 5 deletions src/coreclr/jit/compiler.cpp
Original file line number Diff line number Diff line change
@@ -2262,11 +2262,6 @@ void Compiler::compSetProcessor()

preferredVectorByteLength = 256 / 8;
}

if (instructionSetFlags.HasInstructionSet(InstructionSet_VPCLMULQDQ))
{
instructionSetFlags.AddInstructionSet(InstructionSet_VPCLMULQDQ_V512);
}
}
else
{
@@ -6179,6 +6174,7 @@ int Compiler::compCompile(CORINFO_MODULE_HANDLE classPtr,
if (JitConfig.EnableVPCLMULQDQ() != 0)
{
instructionSetFlags.AddInstructionSet(InstructionSet_VPCLMULQDQ);
instructionSetFlags.AddInstructionSet(InstructionSet_VPCLMULQDQ_V512);
}

if (JitConfig.EnablePOPCNT() != 0)
Original file line number Diff line number Diff line change
@@ -137,7 +137,11 @@ public static void AddToBuilder(InstructionSetSupportBuilder builder, int flags)
if ((flags & Evex) != 0)
builder.AddSupportedInstructionSet("evex");
if ((flags & Vpclmulqdq) != 0)
builder.AddSupportedInstructionSet("vpclmulqdq");
{
builder.AddSupportedInstructionSet("vpclmul");
if ((flags & Avx512) != 0)
builder.AddSupportedInstructionSet("vpclmul_v512");
}
}

public static int FromInstructionSet(InstructionSet instructionSet)
@@ -203,7 +207,7 @@ public static int FromInstructionSet(InstructionSet instructionSet)
InstructionSet.X64_EVEX => Evex,
InstructionSet.X64_EVEX_X64 => Evex,
InstructionSet.X64_VPCLMULQDQ => Vpclmulqdq,
InstructionSet.X64_VPCLMULQDQ_V512 => Vpclmulqdq,
InstructionSet.X64_VPCLMULQDQ_V512 => (Vpclmulqdq | Avx512),

// Baseline ISAs - they're always available
InstructionSet.X64_SSE => 0,
1 change: 1 addition & 0 deletions src/coreclr/vm/codeman.cpp
Original file line number Diff line number Diff line change
@@ -1395,6 +1395,7 @@ void EEJitManager::SetCpuInfo()
if (((cpuFeatures & XArchIntrinsicConstants_Vpclmulqdq) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableVPCLMULQDQ))
{
CPUCompileFlags.Set(InstructionSet_VPCLMULQDQ);
CPUCompileFlags.Set(InstructionSet_VPCLMULQDQ_V512);
}

if (((cpuFeatures & XArchIntrinsicConstants_AvxVnni) != 0) && CLRConfig::GetConfigValue(CLRConfig::EXTERNAL_EnableAVXVNNI))
Loading