You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Vector256.Shuffle() returns incorrect result when index is out of bounds #85132
Vector256.Shuffle() returns incorrect result when index is out of bounds. When index is out of bounds, expected to return 0 for that and rest of values correctly
Reproduction Steps
using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics;
using System.Numerics;
namespace InterfaceMain
{
interface Program
{
public static unsafe int Main()
{
Vector256<int> v256Shuffle1 = Vector256.Create(100, 101, 102, 103, 104, 105, 106, 107);
Vector256<int> resultElements256Shuffle = Vector256Shuffle(v256Shuffle1);
Console.Write("\n Vector256Shuffle [ ");
for (int index = 0; index < Vector256<int>.Count; index++)
{
Console.Write(resultElements256Shuffle[index] + ", ");
}
Console.Write("]\n Vector256Shuffle Done \n");
return 100;
}
[MethodImpl(MethodImplOptions.NoInlining)]
public static unsafe Vector256<int> Vector256Shuffle(Vector256<int> v1)
{
return Vector256.Shuffle(v1, Vector256.Create(7, 555, 3, 1, 6, 4, 2, 0));
}
}
}
Expected behavior
Not crash and return 0 for out of bound index
Actual behavior
Crashed on latest main for Debug build
on 7.0, returns incorrect value on sharplab(release?) :
Activity
tannergooding commentedon May 26, 2023
This was resolved in #86453