Skip to content

Commit

Permalink
Ensure we handle HWIntrinsics being disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
tannergooding committed May 21, 2023
1 parent 9eeefd7 commit 079e9b0
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions src/coreclr/jit/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -8696,25 +8696,33 @@ XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
uint32_t getMaxVectorByteLength() const
{
#if defined(FEATURE_HW_INTRINSICS) && defined(TARGET_XARCH)
if (compOpportunisticallyDependsOn(InstructionSet_AVX))
if (compOpportunisticallyDependsOn(InstructionSet_AVX512F))
{
if (compOpportunisticallyDependsOn(InstructionSet_AVX512F))
{
return ZMM_REGSIZE_BYTES;
}
else
{
return YMM_REGSIZE_BYTES;
}
return ZMM_REGSIZE_BYTES;
}
else
else if (compOpportunisticallyDependsOn(InstructionSet_AVX))
{
return YMM_REGSIZE_BYTES;
}
else if (compOpportunisticallyDependsOn(InstructionSet_SSE))
{
assert(compIsaSupportedDebugOnly(InstructionSet_SSE));
return XMM_REGSIZE_BYTES;
}
else
{
assert((JitConfig.EnableHWIntrinsic() == 0) || (JitConfig.EnableSSE() == 0));
return 0;
}
#elif defined(TARGET_ARM64)
assert(compIsaSupportedDebugOnly(InstructionSet_AdvSimd));
return FP_REGSIZE_BYTES;
if (compOpportunisticallyDependsOn(InstructionSet_AdvSimd))
{
return FP_REGSIZE_BYTES;
}
else
{
assert((JitConfig.EnableHWIntrinsic() == 0) || (JitConfig.EnableArm64AdvSimd() == 0));
return 0;
}
#else
assert(!"getMaxVectorByteLength() unimplemented on target arch");
unreached();
Expand Down

0 comments on commit 079e9b0

Please sign in to comment.