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
Comment change and implement ShuffleUnsafe for sbyte
- Implement `ShuffleUnsafe` for `sbyte`
- Remove remaining detailed comment on V128.ShuffleUnsafe (which specified which intrinsics were used): it is not good to only have it for this one, which could also theoretically change behaviour in the future e.g., with the introduction of RISC-V
Copy file name to clipboardexpand all lines: src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs
+31-3
Original file line number
Diff line number
Diff line change
@@ -2363,9 +2363,7 @@ public static Vector128<sbyte> Shuffle(Vector128<sbyte> vector, Vector128<sbyte>
2363
2363
/// <param name="vector">The input vector from which values are selected.</param>
2364
2364
/// <param name="indices">The per-element indices used to select a value from <paramref name="vector" />.</param>
2365
2365
/// <returns>A new vector containing the values from <paramref name="vector" /> selected by the given <paramref name="indices" />.</returns>
2366
-
/// <remarks>Unlike Shuffle, this method delegates to the underlying hardware intrinsic without ensuring that <paramref name="indices"/> are normalized to [0, 15].
2367
-
/// On hardware with <see cref="Ssse3"/> support, indices are treated as modulo 16, and if the high bit is set, the result will be set to 0 for that element.
2368
-
/// On hardware with <see cref="AdvSimd.Arm64"/> or <see cref="PackedSimd"/> support, this method behaves the same as Shuffle.</remarks>
2366
+
/// <remarks>Unlike Shuffle, this method delegates to the underlying hardware intrinsic without ensuring that <paramref name="indices"/> are normalized to [0, 15].</remarks>
2369
2367
[Intrinsic]
2370
2368
[CompExactlyDependsOn(typeof(Ssse3))]
2371
2369
[CompExactlyDependsOn(typeof(AdvSimd))]
@@ -2390,6 +2388,36 @@ public static Vector128<byte> ShuffleUnsafe(Vector128<byte> vector, Vector128<by
2390
2388
returnresult;
2391
2389
}
2392
2390
2391
+
/// <summary>Creates a new vector by selecting values from an input vector using a set of indices.
2392
+
/// Behavior is platform-dependent for out-of-range indices.</summary>
2393
+
/// <param name="vector">The input vector from which values are selected.</param>
2394
+
/// <param name="indices">The per-element indices used to select a value from <paramref name="vector" />.</param>
2395
+
/// <returns>A new vector containing the values from <paramref name="vector" /> selected by the given <paramref name="indices" />.</returns>
2396
+
/// <remarks>Unlike Shuffle, this method delegates to the underlying hardware intrinsic without ensuring that <paramref name="indices"/> are normalized to [0, 15].</remarks>
Copy file name to clipboardexpand all lines: src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs
+28
Original file line number
Diff line number
Diff line change
@@ -2369,6 +2369,34 @@ public static Vector256<byte> ShuffleUnsafe(Vector256<byte> vector, Vector256<by
2369
2369
returnresult;
2370
2370
}
2371
2371
2372
+
/// <summary>Creates a new vector by selecting values from an input vector using a set of indices.
2373
+
/// Behavior is platform-dependent for out-of-range indices.</summary>
2374
+
/// <param name="vector">The input vector from which values are selected.</param>
2375
+
/// <param name="indices">The per-element indices used to select a value from <paramref name="vector" />.</param>
2376
+
/// <returns>A new vector containing the values from <paramref name="vector" /> selected by the given <paramref name="indices" />.</returns>
2377
+
/// <remarks>Unlike Shuffle, this method delegates to the underlying hardware intrinsic without ensuring that <paramref name="indices"/> are normalized to [0, 31].</remarks>
Copy file name to clipboardexpand all lines: src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs
+27
Original file line number
Diff line number
Diff line change
@@ -2415,6 +2415,33 @@ public static Vector512<byte> ShuffleUnsafe(Vector512<byte> vector, Vector512<by
2415
2415
returnresult;
2416
2416
}
2417
2417
2418
+
/// <summary>Creates a new vector by selecting values from an input vector using a set of indices.
2419
+
/// Behavior is platform-dependent for out-of-range indices.</summary>
2420
+
/// <param name="vector">The input vector from which values are selected.</param>
2421
+
/// <param name="indices">The per-element indices used to select a value from <paramref name="vector" />.</param>
2422
+
/// <returns>A new vector containing the values from <paramref name="vector" /> selected by the given <paramref name="indices" />.</returns>
2423
+
/// <remarks>Unlike Shuffle, this method delegates to the underlying hardware intrinsic without ensuring that <paramref name="indices"/> are normalized to [0, 63].</remarks>
Copy file name to clipboardexpand all lines: src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs
+27
Original file line number
Diff line number
Diff line change
@@ -2284,6 +2284,33 @@ public static Vector64<byte> ShuffleUnsafe(Vector64<byte> vector, Vector64<byte>
2284
2284
returnresult;
2285
2285
}
2286
2286
2287
+
/// <summary>Creates a new vector by selecting values from an input vector using a set of indices.
2288
+
/// Behavior is platform-dependent for out-of-range indices.</summary>
2289
+
/// <param name="vector">The input vector from which values are selected.</param>
2290
+
/// <param name="indices">The per-element indices used to select a value from <paramref name="vector" />.</param>
2291
+
/// <returns>A new vector containing the values from <paramref name="vector" /> selected by the given <paramref name="indices" />.</returns>
2292
+
/// <remarks>Unlike Shuffle, this method delegates to the underlying hardware intrinsic without ensuring that <paramref name="indices"/> are normalized to [0, 7].</remarks>
0 commit comments