Skip to content

Commit f3d90b2

Browse files
authored
Add remark to ConditionalSelect (#111945)
* Update Vector files * Update Vector.cs * Address Feedback
1 parent f552567 commit f3d90b2

File tree

6 files changed

+8
-0
lines changed

6 files changed

+8
-0
lines changed

src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ public static Vector<T> ClampNative<T>(Vector<T> value, Vector<T> min, Vector<T>
349349
/// <param name="right">The vector that is selected when the corresponding bit in <paramref name="condition" /> is zero.</param>
350350
/// <typeparam name="T">The type of the elements in the vector.</typeparam>
351351
/// <returns>A vector whose bits come from <paramref name="left" /> or <paramref name="right" /> based on the value of <paramref name="condition" />.</returns>
352+
/// <remarks>The returned vector is equivalent to <paramref name="condition" /> <c>?</c> <paramref name="left" /> <c>:</c> <paramref name="right" /> on a per-bit basis.</remarks>
352353
[Intrinsic]
353354
[MethodImpl(MethodImplOptions.AggressiveInlining)]
354355
public static Vector<T> ConditionalSelect<T>(Vector<T> condition, Vector<T> left, Vector<T> right) => (left & condition) | AndNot(right, condition);
@@ -358,6 +359,7 @@ public static Vector<T> ClampNative<T>(Vector<T> value, Vector<T> min, Vector<T>
358359
/// <param name="left">The vector that is selected when the corresponding bit in <paramref name="condition" /> is one.</param>
359360
/// <param name="right">The vector that is selected when the corresponding bit in <paramref name="condition" /> is zero.</param>
360361
/// <returns>A vector whose bits come from <paramref name="left" /> or <paramref name="right" /> based on the value of <paramref name="condition" />.</returns>
362+
/// <remarks>The returned vector is equivalent to <paramref name="condition" /> <c>?</c> <paramref name="left" /> <c>:</c> <paramref name="right" /> on a per-bit basis.</remarks>
361363
[Intrinsic]
362364
public static Vector<float> ConditionalSelect(Vector<int> condition, Vector<float> left, Vector<float> right) => ConditionalSelect(condition.As<int, float>(), left, right);
363365

@@ -366,6 +368,7 @@ public static Vector<T> ClampNative<T>(Vector<T> value, Vector<T> min, Vector<T>
366368
/// <param name="left">The vector that is selected when the corresponding bit in <paramref name="condition" /> is one.</param>
367369
/// <param name="right">The vector that is selected when the corresponding bit in <paramref name="condition" /> is zero.</param>
368370
/// <returns>A vector whose bits come from <paramref name="left" /> or <paramref name="right" /> based on the value of <paramref name="condition" />.</returns>
371+
/// <remarks>The returned vector is equivalent to <paramref name="condition" /> <c>?</c> <paramref name="left" /> <c>:</c> <paramref name="right" /> on a per-bit basis.</remarks>
369372
[Intrinsic]
370373
public static Vector<double> ConditionalSelect(Vector<long> condition, Vector<double> left, Vector<double> right) => ConditionalSelect(condition.As<long, double>(), left, right);
371374

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/ISimdVector_2.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ internal unsafe interface ISimdVector<TSelf, T>
166166
/// <param name="right">The vector that is selected when the corresponding bit in <paramref name="condition" /> is zero.</param>
167167
/// <returns>A vector whose bits come from <paramref name="left" /> or <paramref name="right" /> based on the value of <paramref name="condition" />.</returns>
168168
/// <exception cref="NotSupportedException">The type of the elements in the vector (<typeparamref name="T" />) is not supported.</exception>
169+
/// <remarks>The returned vector is equivalent to <paramref name="condition" /> <c>?</c> <paramref name="left" /> <c>:</c> <paramref name="right" /> on a per-bit basis.</remarks>
169170
static virtual TSelf ConditionalSelect(TSelf condition, TSelf left, TSelf right) => (left & condition) | (right & ~condition);
170171

171172
/// <summary>Copies the per-element sign of a vector to the per-element sign of another vector.</summary>

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,7 @@ public static Vector128<T> ClampNative<T>(Vector128<T> value, Vector128<T> min,
346346
/// <param name="right">The vector that is selected when the corresponding bit in <paramref name="condition" /> is zero.</param>
347347
/// <returns>A vector whose bits come from <paramref name="left" /> or <paramref name="right" /> based on the value of <paramref name="condition" />.</returns>
348348
/// <exception cref="NotSupportedException">The type of <paramref name="condition" />, <paramref name="left" />, and <paramref name="right" /> (<typeparamref name="T" />) is not supported.</exception>
349+
/// <remarks>The returned vector is equivalent to <paramref name="condition" /> <c>?</c> <paramref name="left" /> <c>:</c> <paramref name="right" /> on a per-bit basis.</remarks>
349350
[Intrinsic]
350351
[MethodImpl(MethodImplOptions.AggressiveInlining)]
351352
public static Vector128<T> ConditionalSelect<T>(Vector128<T> condition, Vector128<T> left, Vector128<T> right) => (left & condition) | AndNot(right, condition);

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ public static Vector256<T> ClampNative<T>(Vector256<T> value, Vector256<T> min,
384384
/// <param name="right">The vector that is selected when the corresponding bit in <paramref name="condition" /> is zero.</param>
385385
/// <returns>A vector whose bits come from <paramref name="left" /> or <paramref name="right" /> based on the value of <paramref name="condition" />.</returns>
386386
/// <exception cref="NotSupportedException">The type of <paramref name="condition" />, <paramref name="left" />, and <paramref name="right" /> (<typeparamref name="T" />) is not supported.</exception>
387+
/// <remarks>The returned vector is equivalent to <paramref name="condition" /> <c>?</c> <paramref name="left" /> <c>:</c> <paramref name="right" /> on a per-bit basis.</remarks>
387388
[Intrinsic]
388389
[MethodImpl(MethodImplOptions.AggressiveInlining)]
389390
public static Vector256<T> ConditionalSelect<T>(Vector256<T> condition, Vector256<T> left, Vector256<T> right) => (left & condition) | AndNot(right, condition);

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector512.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,7 @@ public static Vector512<T> ClampNative<T>(Vector512<T> value, Vector512<T> min,
384384
/// <param name="right">The vector that is selected when the corresponding bit in <paramref name="condition" /> is zero.</param>
385385
/// <returns>A vector whose bits come from <paramref name="left" /> or <paramref name="right" /> based on the value of <paramref name="condition" />.</returns>
386386
/// <exception cref="NotSupportedException">The type of <paramref name="condition" />, <paramref name="left" />, and <paramref name="right" /> (<typeparamref name="T" />) is not supported.</exception>
387+
/// <remarks>The returned vector is equivalent to <paramref name="condition" /> <c>?</c> <paramref name="left" /> <c>:</c> <paramref name="right" /> on a per-bit basis.</remarks>
387388
[Intrinsic]
388389
[MethodImpl(MethodImplOptions.AggressiveInlining)]
389390
public static Vector512<T> ConditionalSelect<T>(Vector512<T> condition, Vector512<T> left, Vector512<T> right) => (left & condition) | AndNot(right, condition);

src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ public static Vector64<T> ClampNative<T>(Vector64<T> value, Vector64<T> min, Vec
352352
/// <param name="right">The vector that is selected when the corresponding bit in <paramref name="condition" /> is zero.</param>
353353
/// <returns>A vector whose bits come from <paramref name="left" /> or <paramref name="right" /> based on the value of <paramref name="condition" />.</returns>
354354
/// <exception cref="NotSupportedException">The type of <paramref name="condition" />, <paramref name="left" />, and <paramref name="right" /> (<typeparamref name="T" />) is not supported.</exception>
355+
/// <remarks>The returned vector is equivalent to <paramref name="condition" /> <c>?</c> <paramref name="left" /> <c>:</c> <paramref name="right" /> on a per-bit basis.</remarks>
355356
[Intrinsic]
356357
[MethodImpl(MethodImplOptions.AggressiveInlining)]
357358
public static Vector64<T> ConditionalSelect<T>(Vector64<T> condition, Vector64<T> left, Vector64<T> right) => (left & condition) | AndNot(right, condition);

0 commit comments

Comments
 (0)