Closed tannergooding closed 4 months ago
Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch See info in area-owners.md if you want to be subscribed.
Author: | tannergooding |
---|---|
Assignees: | - |
Labels: | `area-CodeGen-coreclr`, `untriaged` |
Milestone: | - |
CC. @fanyang-mono
Note that this does not repro for Vector64
which should be accelerated on Arm64. So this looks like an x86/x64 specific issue.
I can repro this on x64, but not on arm64.
Since it's x64, that's less of a priority within mono. @vargaz @fanyang-mono is this an easy fix?
Not sure what the problem is exactly by looking at the repro program.
My guess is that ConditionalSelect
is potentially being mishandled on x86/x64.
The exposed managed API is mask, left, right
. On Arm64 this maps to bsl mask, left, right
. On x64 this has to be emulated as (left & mask) | (right & ~mask)
or if you know that mask
is "AllBitsSet" or "Zero" on a per-element basis you can instead use pblendvb right, left, mask
(so effectively parameter order is inverted).
Alternatively, it could be a bug with GreaterThan
(double) since it has to be emulated using cmpltpd right, left
(swapping the operands and using less than
instead) on pre-AVX hardware (Mono notably doesn't support AVX today, to my knowledge).
GreaterThanAny
(ulong) also needs to be emulated on pre SSE4.2 hardware so it could be that, but I expect that is already being handled.
The following program fails on Mono and returns
+∞
instead ofNaN
as expected. This is likely an error somewhere in the branch handling edge case inputs at the end of theInvoke
function. It was caught as part of https://github.com/dotnet/runtime/pull/97114