Adding some AggressiveInlining attributes to the Vector64/128/256 helper methods...
authorTanner Gooding <tagoo@outlook.com>
Tue, 20 Nov 2018 15:56:52 +0000 (07:56 -0800)
committerGitHub <noreply@github.com>
Tue, 20 Nov 2018 15:56:52 +0000 (07:56 -0800)
src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128_1.cs
src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256_1.cs
src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector64_1.cs

index d8d4095..3f8523a 100644 (file)
@@ -59,6 +59,7 @@ namespace System.Runtime.Intrinsics
 
         internal static bool IsSupported
         {
+            [MethodImpl(MethodImplOptions.AggressiveInlining)]
             get
             {
                 return (typeof(T) == typeof(byte)) ||
@@ -74,6 +75,7 @@ namespace System.Runtime.Intrinsics
             }
         }
 
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
         internal static void ThrowIfUnsupportedType()
         {
             if (!IsSupported)
@@ -86,6 +88,7 @@ namespace System.Runtime.Intrinsics
         /// <typeparam name="U">The type of the vector the current instance should be reinterpreted as.</typeparam>
         /// <returns>The current instance reinterpreted as a new <see cref="Vector128{U}" />.</returns>
         /// <exception cref="NotSupportedException">The type of the current instance (<typeparamref name="T" />) or the type of the target (<typeparamref name="U" />) is not supported.</exception>
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public Vector128<U> As<U>() where U : struct
         {
             ThrowIfUnsupportedType();
index cd49d48..d040ce9 100644 (file)
@@ -61,6 +61,7 @@ namespace System.Runtime.Intrinsics
 
         internal static bool IsSupported
         {
+            [MethodImpl(MethodImplOptions.AggressiveInlining)]
             get
             {
                 return (typeof(T) == typeof(byte)) ||
@@ -76,6 +77,7 @@ namespace System.Runtime.Intrinsics
             }
         }
 
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
         internal static void ThrowIfUnsupportedType()
         {
             if (!IsSupported)
@@ -88,6 +90,7 @@ namespace System.Runtime.Intrinsics
         /// <typeparam name="U">The type of the vector the current instance should be reinterpreted as.</typeparam>
         /// <returns>The current instance reinterpreted as a new <see cref="Vector256{U}" />.</returns>
         /// <exception cref="NotSupportedException">The type of the current instance (<typeparamref name="T" />) or the type of the target (<typeparamref name="U" />) is not supported.</exception>
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public Vector256<U> As<U>() where U : struct
         {
             ThrowIfUnsupportedType();
index da9d0d2..99a1e9e 100644 (file)
@@ -58,6 +58,7 @@ namespace System.Runtime.Intrinsics
 
         internal static bool IsSupported
         {
+            [MethodImpl(MethodImplOptions.AggressiveInlining)]
             get
             {
                 return (typeof(T) == typeof(byte)) ||
@@ -73,6 +74,7 @@ namespace System.Runtime.Intrinsics
             }
         }
 
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
         internal static void ThrowIfUnsupportedType()
         {
             if (!IsSupported)
@@ -85,6 +87,7 @@ namespace System.Runtime.Intrinsics
         /// <typeparam name="U">The type of the vector the current instance should be reinterpreted as.</typeparam>
         /// <returns>The current instance reinterpreted as a new <see cref="Vector64{U}" />.</returns>
         /// <exception cref="NotSupportedException">The type of the current instance (<typeparamref name="T" />) or the type of the target (<typeparamref name="U" />) is not supported.</exception>
+        [MethodImpl(MethodImplOptions.AggressiveInlining)]
         public Vector64<U> As<U>() where U : struct
         {
             ThrowIfUnsupportedType();