Skip to content

Commit 8ad5895

Browse files
committed
Add new test cases, include byte vector case
1 parent 89735b8 commit 8ad5895

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/tests/JIT/Regression/JitBlue/Runtime_114572/Runtime_114572.cs

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ public class Runtime_114572
1818
{
1919
public static Vector256<ushort> s_2;
2020
public static ushort s_4;
21+
public static byte s_ub = 1;
22+
public static ushort s_us = 1;
2123

2224
[Fact]
2325
public static void Problem()
@@ -37,4 +39,34 @@ public static void Problem()
3739
Assert.Equal(Vector256.Create((ushort)0, (ushort)1, (ushort)1, (ushort)1, (ushort)1, (ushort)1, (ushort)1, (ushort)1, (ushort)1, (ushort)1, (ushort)1, (ushort)1, (ushort)1, (ushort)1, (ushort)1, (ushort)1), s_2);
3840
}
3941
}
42+
43+
[Fact]
44+
public static void Problem2()
45+
{
46+
if (Avx512F.VL.IsSupported)
47+
{
48+
var v0 = Vector128<ushort>.Zero;
49+
var v1 = Vector128<ushort>.One;
50+
var vs = Vector128.CreateScalar(s_us);
51+
52+
var vr = Avx512F.VL.TernaryLogic(v0, v1, Avx512BW.VL.CompareGreaterThanOrEqual(v0, vs), 0xE4);
53+
Console.WriteLine(vr);
54+
Assert.Equal(Vector128.Create((ushort)1, (ushort)0, (ushort)0, (ushort)0, (ushort)0, (ushort)0, (ushort)0, (ushort)0), vr);
55+
}
56+
}
57+
58+
[Fact]
59+
public static void Problem3()
60+
{
61+
if (Avx512F.VL.IsSupported)
62+
{
63+
var v0 = Vector128<byte>.Zero;
64+
var v1 = Vector128<byte>.One;
65+
var vs = Vector128.CreateScalar(s_ub);
66+
67+
var vr = Avx512F.VL.TernaryLogic(v0, v1, Avx512BW.VL.CompareGreaterThanOrEqual(v0, vs), 0xE4);
68+
Console.WriteLine(vr);
69+
Assert.Equal(Vector128.Create((byte)1, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0, (byte)0), vr);
70+
}
71+
}
4072
}

0 commit comments

Comments
 (0)