ARM64: bad codegen for Vector.Dot
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
The following code returns a different value under jit optimizations on arm64:
```
public static int Main()
{
int result = Vector128.IndexOf(
AdvSimd.SubtractRoundedHighNarrowingUpper(Vector64.AllBitsSet,
Vector128.AllBitsSet,
Vector128.AllBitsSet),
Vector.Dot(Vector.One, Vector.One));
return result == -1 ? 100 : 101;
}
```
jit generates CMEQ for Vector IndexOf which expects the dot product in every lane.
Lowering for this Vector.Dot uses AddAcross (ADDV) which writes to only lane 0.
Either we shouldn't have dropped the toScalar+Create during Morph, or lower must explicitly broadcast as well.
Contributor guide
Assessment
This issue has not been assessed yet.