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

JIT: Check ISA directly when printing JitDisasm #112828

Merged
merged 2 commits into from
Feb 24, 2025
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
27 changes: 15 additions & 12 deletions src/coreclr/jit/codegencommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1827,11 +1827,14 @@ void CodeGen::genGenerateMachineCode()
printf(" for ");

#if defined(TARGET_X86)
if (compiler->canUseEvexEncoding())
// Check ISA directly here instead of using
// compOpportunisticallyDependsOn to avoid JIT-EE calls that could make
// us miss in SPMI
if (compiler->opts.compSupportsISA.HasInstructionSet(InstructionSet_EVEX))
{
if (compiler->compOpportunisticallyDependsOn(InstructionSet_AVX10v2))
if (compiler->opts.compSupportsISA.HasInstructionSet(InstructionSet_AVX10v2))
{
if (compiler->compOpportunisticallyDependsOn(InstructionSet_AVX10v2_V512))
if (compiler->opts.compSupportsISA.HasInstructionSet(InstructionSet_AVX10v2_V512))
{
printf("X86 with AVX10.2/512");
}
Expand All @@ -1840,9 +1843,9 @@ void CodeGen::genGenerateMachineCode()
printf("X86 with AVX10.2/256");
}
}
else if (compiler->compOpportunisticallyDependsOn(InstructionSet_AVX10v1))
else if (compiler->opts.compSupportsISA.HasInstructionSet(InstructionSet_AVX10v1))
{
if (compiler->compOpportunisticallyDependsOn(InstructionSet_AVX10v1_V512))
if (compiler->opts.compSupportsISA.HasInstructionSet(InstructionSet_AVX10v1_V512))
{
printf("X86 with AVX10.1/512");
}
Expand All @@ -1857,7 +1860,7 @@ void CodeGen::genGenerateMachineCode()
printf("X86 with AVX512");
}
}
else if (compiler->canUseVexEncoding())
else if (compiler->opts.compSupportsISA.HasInstructionSet(InstructionSet_AVX))
{
printf("X86 with AVX");
}
Expand All @@ -1866,11 +1869,11 @@ void CodeGen::genGenerateMachineCode()
printf("generic X86");
}
#elif defined(TARGET_AMD64)
if (compiler->canUseEvexEncoding())
if (compiler->opts.compSupportsISA.HasInstructionSet(InstructionSet_EVEX))
{
if (compiler->compOpportunisticallyDependsOn(InstructionSet_AVX10v2))
if (compiler->opts.compSupportsISA.HasInstructionSet(InstructionSet_AVX10v2))
{
if (compiler->compOpportunisticallyDependsOn(InstructionSet_AVX10v2_V512))
if (compiler->opts.compSupportsISA.HasInstructionSet(InstructionSet_AVX10v2_V512))
{
printf("X64 with AVX10.2/512");
}
Expand All @@ -1879,9 +1882,9 @@ void CodeGen::genGenerateMachineCode()
printf("X64 with AVX10.2/256");
}
}
else if (compiler->compOpportunisticallyDependsOn(InstructionSet_AVX10v1))
else if (compiler->opts.compSupportsISA.HasInstructionSet(InstructionSet_AVX10v1))
{
if (compiler->compOpportunisticallyDependsOn(InstructionSet_AVX10v1_V512))
if (compiler->opts.compSupportsISA.HasInstructionSet(InstructionSet_AVX10v1_V512))
{
printf("X64 with AVX10.1/512");
}
Expand All @@ -1896,7 +1899,7 @@ void CodeGen::genGenerateMachineCode()
printf("X64 with AVX512");
}
}
else if (compiler->canUseVexEncoding())
else if (compiler->opts.compSupportsISA.HasInstructionSet(InstructionSet_AVX))
{
printf("X64 with AVX");
}
Expand Down
Loading