Repro
using System;
using System.Runtime.CompilerServices;
using System.Runtime.Intrinsics;
using System.Runtime.Intrinsics.X86;
class Program
{
// The broadcast source is a runtime load, not a constant.
[MethodImpl(MethodImplOptions.NoInlining | MethodImplOptions.AggressiveOptimization)]
static unsafe Vector128<double> Test(Vector128<float> v, float* p,
Vector128<double> a, Vector128<double> b, Vector128<double> f)
{
Vector128<float> anded = Sse.And(v, Vector128.Create(*p));
return Vector128.ConditionalSelect(Vector128.Equals(a, b), anded.AsDouble(), f);
}
static unsafe void Main()
{
if (!Avx512F.VL.IsSupported)
throw new PlatformNotSupportedException("AVX-512VL is required.");
float x = 1.0f;
var eq = Vector128.Create(1.0);
Console.WriteLine(Test(Vector128.Create(1.0f), &x, eq, eq, Vector128.Create(9.0))
.AsUInt32().GetElement(0).ToString("X8"));
}
}
Expected
Actual
Assert failure(PID 46276 [0x0000b4c4], Thread: 112720 [0x1b850]): Assertion failed 'constNode->OperIs(GT_CNS_INT)' in 'Program:Test(System.Runtime.Intrinsics.Vector128`1[float],ptr,System.Runtime.Intrinsics.Vector128`1[double],System.Runtime.Intrinsics.Vector128`1[double],System.Runtime.Intrinsics.Vector128`1[double]):System.Runtime.Intrinsics.Vector128`1[double]' during 'Lowering nodeinfo' (IL size 35; hash 0xbc6a6a4e; FullOpts)
File: C:\prj\runtime-main3\src\coreclr\jit\lowerxarch.cpp:10519
The same assert fires with Sse.Xor in place of Sse.And, and with the int/long forms. The
Vector256 and Vector512 shapes of the same pattern instead fail an adjacent assert
(tgtMaskSize == 2, lowerxarch.cpp:10509).
Platform
Windows x64 with AVX-512VL, local Checked build of dotnet/runtime main (ef97eb5).
Repro
Expected
Actual
The same assert fires with
Sse.Xorin place ofSse.And, and with theint/longforms. TheVector256andVector512shapes of the same pattern instead fail an adjacent assert(
tgtMaskSize == 2,lowerxarch.cpp:10509).Platform
Windows x64 with AVX-512VL, local Checked build of dotnet/runtime main (ef97eb5).