Skip to content

Commit

Permalink
Set tgtPrefOp1 for intrinsics with SIMD-to-SIMD move semantics in lsr…
Browse files Browse the repository at this point in the history
…aarm64.cpp
  • Loading branch information
echesakov committed Aug 6, 2020
1 parent 90d7d8d commit 833aaba
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/coreclr/src/jit/lsraarm64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1050,9 +1050,24 @@ int LinearScan::BuildHWIntrinsic(GenTreeHWIntrinsic* intrinsicTree)

if (intrin.op1 != nullptr)
{
// If we have an RMW intrinsic, we want to preference op1Reg to the target if
// op1 is not contained.
if (isRMW)
bool simdRegToSimdRegMove = false;

if ((intrin.id == NI_Vector64_CreateScalarUnsafe) || (intrin.id == NI_Vector128_CreateScalarUnsafe))
{
simdRegToSimdRegMove = varTypeIsFloating(intrin.op1);
}
else if (intrin.id == NI_AdvSimd_Arm64_DuplicateToVector64)
{
simdRegToSimdRegMove = (intrin.op1->TypeGet() == TYP_DOUBLE);
}
else if ((intrin.id == NI_Vector64_ToScalar) || (intrin.id == NI_Vector128_ToScalar))
{
simdRegToSimdRegMove = varTypeIsFloating(intrinsicTree);
}

// If we have an RMW intrinsic or an intrinsic with simple move semantic between two SIMD registers,
// we want to preference op1Reg to the target if op1 is not contained.
if (isRMW || simdRegToSimdRegMove)
{
tgtPrefOp1 = !intrin.op1->isContained();
}
Expand Down

0 comments on commit 833aaba

Please sign in to comment.