From f5c67acfbf098b34cada6adc1a0c9f37bde8b9bd Mon Sep 17 00:00:00 2001 From: Drew Kersnar <18474647+dakersnar@users.noreply.github.com> Date: Wed, 2 Nov 2022 12:02:30 -0500 Subject: [PATCH] Fix triple slash documentation for System.Runtime.Intrinsics (#76687) * Add missing type param documentation for Vector64.Create * Add summaries to the Vector types * Fix typeparamref * Address PR feedback --- .../System.Private.CoreLib/src/System/Numerics/Vector.cs | 2 +- .../System.Private.CoreLib/src/System/Numerics/Vector_1.cs | 7 ++----- .../src/System/Runtime/Intrinsics/Vector128.cs | 1 + .../src/System/Runtime/Intrinsics/Vector128_1.cs | 3 +++ .../src/System/Runtime/Intrinsics/Vector256.cs | 1 + .../src/System/Runtime/Intrinsics/Vector256_1.cs | 4 +++- .../src/System/Runtime/Intrinsics/Vector64.cs | 2 ++ .../src/System/Runtime/Intrinsics/Vector64_1.cs | 2 ++ 8 files changed, 15 insertions(+), 7 deletions(-) diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs index 660013c95fb..64a0ff3ebd4 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector.cs @@ -8,7 +8,7 @@ namespace System.Numerics { - /// Provides a collection of static convenience methods for creating, manipulating, combining, and converting generic vectors. + /// Provides a collection of static methods for creating, manipulating, and otherwise operating on generic vectors. [Intrinsic] public static unsafe partial class Vector { diff --git a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs index 22f88a19d80..05eb1efcafd 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Numerics/Vector_1.cs @@ -23,11 +23,8 @@ namespace System.Numerics * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ - /// - /// A structure that represents a single Vector. The count of this Vector is fixed but CPU register dependent. - /// This struct only supports numerical types. This type is intended to be used as a building block for vectorizing - /// large algorithms. This type is immutable, individual elements cannot be modified. - /// + /// Represents a single vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms. + /// The type of the elements in the vector. can be any primitive numeric type. [Intrinsic] [DebuggerDisplay("{DisplayString,nq}")] [DebuggerTypeProxy(typeof(VectorDebugView<>))] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs index 8e557fbfcd2..98d99645709 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128.cs @@ -28,6 +28,7 @@ namespace System.Runtime.Intrinsics // value instead, thus reducing the number of locals and helping prevent us from hitting // the internal inlining limits of the JIT. + /// Provides a collection of static methods for creating, manipulating, and otherwise operating on 128-bit vectors. public static class Vector128 { internal const int Size = 16; diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs index ee24ac43720..541f64416fc 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector128_1.cs @@ -22,6 +22,9 @@ namespace System.Runtime.Intrinsics // This ensures we get good codegen for the "fast-path" and allows the JIT to // determine inline profitability of the other paths as it would normally. + + /// Represents a 128-bit vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms. + /// The type of the elements in the vector. [Intrinsic] [DebuggerDisplay("{DisplayString,nq}")] [DebuggerTypeProxy(typeof(Vector128DebugView<>))] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs index 5812a503c97..8a6f11b1015 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256.cs @@ -27,6 +27,7 @@ namespace System.Runtime.Intrinsics // value instead, thus reducing the number of locals and helping prevent us from hitting // the internal inlining limits of the JIT. + /// Provides a collection of static methods for creating, manipulating, and otherwise operating on 256-bit vectors. public static unsafe class Vector256 { internal const int Size = 32; diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs index a55cfbc5d65..caa8fe308a2 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector256_1.cs @@ -17,11 +17,13 @@ namespace System.Runtime.Intrinsics // that most of the code-paths will be optimized away as "dead code". // // We then manually inline cases (such as certain intrinsic code-paths) that - // will generate code small enough to make the AgressiveInlining profitable. The + // will generate code small enough to make the AggressiveInlining profitable. The // other cases (such as the software fallback) are placed in their own method. // This ensures we get good codegen for the "fast-path" and allows the JIT to // determine inline profitability of the other paths as it would normally. + /// Represents a 256-bit vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms. + /// The type of the elements in the vector. [Intrinsic] [DebuggerDisplay("{DisplayString,nq}")] [DebuggerTypeProxy(typeof(Vector256DebugView<>))] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs index 2c1479ff967..dad208aeb29 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64.cs @@ -9,6 +9,7 @@ namespace System.Runtime.Intrinsics { + /// Provides a collection of static methods for creating, manipulating, and otherwise operating on 64-bit vectors. public static class Vector64 { internal const int Size = 8; @@ -525,6 +526,7 @@ public static void CopyTo(this Vector64 vector, Span destination) } /// Creates a new instance with all elements initialized to the specified value. + /// The type of the elements in the vector. /// The value that all elements will be initialized to. /// A new with all elements initialized to . [Intrinsic] diff --git a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs index 08b87ae6cce..f7f6f48bb30 100644 --- a/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs +++ b/src/libraries/System.Private.CoreLib/src/System/Runtime/Intrinsics/Vector64_1.cs @@ -22,6 +22,8 @@ namespace System.Runtime.Intrinsics // This ensures we get good codegen for the "fast-path" and allows the JIT to // determine inline profitability of the other paths as it would normally. + /// Represents a 64-bit vector of a specified numeric type that is suitable for low-level optimization of parallel algorithms. + /// The type of the elements in the vector. [Intrinsic] [DebuggerDisplay("{DisplayString,nq}")] [DebuggerTypeProxy(typeof(Vector64DebugView<>))] -- GitLab