Skip to content

Commit

Permalink
Fix SIMD node DOT retType (#88363)
Browse files Browse the repository at this point in the history
* Fix SIMD node DOT retType

* no need for lengthsquared
  • Loading branch information
kunalspathak authored Jul 5, 2023
1 parent 41f9766 commit f11edcd
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/coreclr/jit/simdashwintrinsic.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1080,10 +1080,10 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic,
op1 =
impCloneExpr(op1, &clonedOp1, CHECK_SPILL_ALL, nullptr DEBUGARG("Clone op1 for vector length"));

op1 = gtNewSimdDotProdNode(retType, op1, clonedOp1, simdBaseJitType, simdSize);
op1 = gtNewSimdDotProdNode(simdType, op1, clonedOp1, simdBaseJitType, simdSize);
op1 = gtNewSimdSqrtNode(simdType, op1, simdBaseJitType, simdSize);

return new (this, GT_INTRINSIC)
GenTreeIntrinsic(simdBaseType, op1, NI_System_Math_Sqrt, NO_METHOD_HANDLE);
return gtNewSimdGetElementNode(retType, op1, gtNewIconNode(0), simdBaseJitType, simdSize);
}

case NI_Quaternion_LengthSquared:
Expand Down Expand Up @@ -1446,10 +1446,10 @@ GenTree* Compiler::impSimdAsHWIntrinsicSpecial(NamedIntrinsic intrinsic,
op1 = impCloneExpr(op1, &clonedOp1, CHECK_SPILL_ALL,
nullptr DEBUGARG("Clone diff for vector distance"));

op1 = gtNewSimdDotProdNode(retType, op1, clonedOp1, simdBaseJitType, simdSize);
op1 = gtNewSimdDotProdNode(simdType, op1, clonedOp1, simdBaseJitType, simdSize);
op1 = gtNewSimdSqrtNode(simdType, op1, simdBaseJitType, simdSize);

return new (this, GT_INTRINSIC)
GenTreeIntrinsic(retType, op1, NI_System_Math_Sqrt, NO_METHOD_HANDLE);
return gtNewSimdGetElementNode(retType, op1, gtNewIconNode(0), simdBaseJitType, simdSize);
}

case NI_Vector2_DistanceSquared:
Expand Down

0 comments on commit f11edcd

Please sign in to comment.