Skip to content

Use AVX512 intrinsics for numeric conversion in JIT #93896

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

Closed
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
24 changes: 24 additions & 0 deletions src/coreclr/jit/hwintrinsicxarch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1405,6 +1405,30 @@ GenTree* Compiler::impSpecialIntrinsic(NamedIntrinsic intrinsic,

case NI_Vector128_ConvertToDouble:
case NI_Vector256_ConvertToDouble:
{
assert(sig->numArgs == 1);
assert(varTypeIsLong(simdBaseType));

if (!compOpportunisticallyDependsOn(InstructionSet_AVX512DQ_VL))
{
break;
}

switch (simdSize)
{
case 16:
intrinsic = NI_AVX512DQ_VL_ConvertToVector128Double;
break;
case 32:
intrinsic = NI_AVX512DQ_VL_ConvertToVector256Double;
break;
default:
unreached();
}
op1 = impSIMDPopStack();
retNode = gtNewSimdHWIntrinsicNode(retType, op1, intrinsic, simdBaseJitType, simdSize);
break;
}
case NI_Vector128_ConvertToInt64:
case NI_Vector256_ConvertToInt64:
case NI_Vector128_ConvertToUInt32:
Expand Down