Description
CompareScalar is supposed to return the upper elements of the first operand unchanged, but folding for True/False comparison modes returns a full Zero or AllBitsSet vector.
https://github.com/dotnet/runtime/blob/f62984ce62deecfb90a8ab991e972d1bc460b93e/src/coreclr/jit/gentree.cpp#L33828-L33842
Reproduction Steps
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
Console.WriteLine(CompareFalse(Vector128<float>.One, Vector128<float>.Zero));
[MethodImpl(MethodImplOptions.NoInlining)]
static Vector128<float> CompareFalse(Vector128<float> x, Vector128<float> y)
=> Avx.CompareScalar(x, y, FloatComparisonMode.OrderedFalseSignaling);
Expected behavior
> dotnet run -c release -f net9.0
<0, 1, 1, 1>
Actual behavior
> dotnet run -c release -f net10.0
<0, 0, 0, 0>
Regression?
Yes
Known Workarounds
No response
Configuration
No response
Other information
No response
Description
CompareScalaris supposed to return the upper elements of the first operand unchanged, but folding for True/False comparison modes returns a full Zero or AllBitsSet vector.https://github.com/dotnet/runtime/blob/f62984ce62deecfb90a8ab991e972d1bc460b93e/src/coreclr/jit/gentree.cpp#L33828-L33842
Reproduction Steps
Expected behavior
> dotnet run -c release -f net9.0<0, 1, 1, 1>Actual behavior
> dotnet run -c release -f net10.0<0, 0, 0, 0>Regression?
Yes
Known Workarounds
No response
Configuration
No response
Other information
No response