From: Tanner Gooding Date: Tue, 20 Nov 2018 15:56:52 +0000 (-0800) Subject: Adding some AggressiveInlining attributes to the Vector64/128/256 helper methods... X-Git-Tag: submit/tizen/20210909.063632~11030^2~3296 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c22893ee16b12a847a775ed7c9655648723aff8a;p=platform%2Fupstream%2Fdotnet%2Fruntime.git Adding some AggressiveInlining attributes to the Vector64/128/256 helper methods (dotnet/coreclr#21111) Commit migrated from https://github.com/dotnet/coreclr/commit/dcc47ed99b31161c12b6ed51cf9f69e3116be6c1 --- 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 d8d4095..3f8523a 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 @@ -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 /// The type of the vector the current instance should be reinterpreted as. /// The current instance reinterpreted as a new . /// The type of the current instance () or the type of the target () is not supported. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Vector128 As() where U : struct { ThrowIfUnsupportedType(); 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 cd49d48..d040ce9 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 @@ -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 /// The type of the vector the current instance should be reinterpreted as. /// The current instance reinterpreted as a new . /// The type of the current instance () or the type of the target () is not supported. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Vector256 As() where U : struct { ThrowIfUnsupportedType(); 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 da9d0d2..99a1e9e 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 @@ -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 /// The type of the vector the current instance should be reinterpreted as. /// The current instance reinterpreted as a new . /// The type of the current instance () or the type of the target () is not supported. + [MethodImpl(MethodImplOptions.AggressiveInlining)] public Vector64 As() where U : struct { ThrowIfUnsupportedType();