From 470dcbb2ebbe97357cc79a8c8caebec6b63e63a8 Mon Sep 17 00:00:00 2001 From: Tanner Gooding Date: Fri, 15 Feb 2019 15:17:52 -0800 Subject: [PATCH] Updating some local functions to be 'static' (captureless). (#22635) --- src/System.Private.CoreLib/shared/System/BitOps.cs | 20 +- .../shared/System/Runtime/Intrinsics/Vector128.cs | 344 +++++------ .../System/Runtime/Intrinsics/Vector128_1.cs | 4 +- .../shared/System/Runtime/Intrinsics/Vector256.cs | 668 ++++++++++----------- .../System/Runtime/Intrinsics/Vector256_1.cs | 20 +- 5 files changed, 528 insertions(+), 528 deletions(-) diff --git a/src/System.Private.CoreLib/shared/System/BitOps.cs b/src/System.Private.CoreLib/shared/System/BitOps.cs index 021ee0b..d85f3f5 100644 --- a/src/System.Private.CoreLib/shared/System/BitOps.cs +++ b/src/System.Private.CoreLib/shared/System/BitOps.cs @@ -306,18 +306,18 @@ namespace System return SoftwareFallback(value); - int SoftwareFallback(uint v) + static int SoftwareFallback(uint value) { const uint c1 = 0x_55555555u; const uint c2 = 0x_33333333u; const uint c3 = 0x_0F0F0F0Fu; const uint c4 = 0x_01010101u; - v = v - ((v >> 1) & c1); - v = (v & c2) + ((v >> 2) & c2); - v = (((v + (v >> 4)) & c3) * c4) >> 24; + value = value - ((value >> 1) & c1); + value = (value & c2) + ((value >> 2) & c2); + value = (((value + (value >> 4)) & c3) * c4) >> 24; - return (int)v; + return (int)value; } } @@ -340,18 +340,18 @@ namespace System #else return SoftwareFallback(value); - int SoftwareFallback(ulong v) + static int SoftwareFallback(ulong value) { const ulong c1 = 0x_55555555_55555555ul; const ulong c2 = 0x_33333333_33333333ul; const ulong c3 = 0x_0F0F0F0F_0F0F0F0Ful; const ulong c4 = 0x_01010101_01010101ul; - v = v - ((v >> 1) & c1); - v = (v & c2) + ((v >> 2) & c2); - v = (((v + (v >> 4)) & c3) * c4) >> 56; + value = value - ((value >> 1) & c1); + value = (value & c2) + ((value >> 2) & c2); + value = (((value + (value >> 4)) & c3) * c4) >> 56; - return (int)v; + return (int)value; } #endif } diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128.cs index 69afdaa..c2e530b 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128.cs @@ -202,26 +202,26 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(byte x) + static Vector128 SoftwareFallback(byte value) { var pResult = stackalloc byte[16] { - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -251,12 +251,12 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(double x) + static Vector128 SoftwareFallback(double value) { var pResult = stackalloc double[2] { - x, - x, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -287,18 +287,18 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(short x) + static Vector128 SoftwareFallback(short value) { var pResult = stackalloc short[8] { - x, - x, - x, - x, - x, - x, - x, - x, + value, + value, + value, + value, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -325,14 +325,14 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(int x) + static Vector128 SoftwareFallback(int value) { var pResult = stackalloc int[4] { - x, - x, - x, - x, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -361,12 +361,12 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(long x) + static Vector128 SoftwareFallback(long value) { var pResult = stackalloc long[2] { - x, - x, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -405,26 +405,26 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(sbyte x) + static Vector128 SoftwareFallback(sbyte value) { var pResult = stackalloc sbyte[16] { - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -457,14 +457,14 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(float x) + static Vector128 SoftwareFallback(float value) { var pResult = stackalloc float[4] { - x, - x, - x, - x, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -496,18 +496,18 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(ushort x) + static Vector128 SoftwareFallback(ushort value) { var pResult = stackalloc ushort[8] { - x, - x, - x, - x, - x, - x, - x, - x, + value, + value, + value, + value, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -535,14 +535,14 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(uint x) + static Vector128 SoftwareFallback(uint value) { var pResult = stackalloc uint[4] { - x, - x, - x, - x, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -572,12 +572,12 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(ulong x) + static Vector128 SoftwareFallback(ulong value) { var pResult = stackalloc ulong[2] { - x, - x, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -660,26 +660,26 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15); - Vector128 SoftwareFallback(byte i0, byte i1, byte i2, byte i3, byte i4, byte i5, byte i6, byte i7, byte i8, byte i9, byte i10, byte i11, byte i12, byte i13, byte i14, byte i15) + static Vector128 SoftwareFallback(byte e0, byte e1, byte e2, byte e3, byte e4, byte e5, byte e6, byte e7, byte e8, byte e9, byte e10, byte e11, byte e12, byte e13, byte e14, byte e15) { var pResult = stackalloc byte[16] { - i0, - i1, - i2, - i3, - i4, - i5, - i6, - i7, - i8, - i9, - i10, - i11, - i12, - i13, - i14, - i15, + e0, + e1, + e2, + e3, + e4, + e5, + e6, + e7, + e8, + e9, + e10, + e11, + e12, + e13, + e14, + e15, }; return Unsafe.AsRef>(pResult); @@ -703,12 +703,12 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1); - Vector128 SoftwareFallback(double i0, double i1) + static Vector128 SoftwareFallback(double e0, double e1) { var pResult = stackalloc double[2] { - i0, - i1, + e0, + e1, }; return Unsafe.AsRef>(pResult); @@ -742,18 +742,18 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3, e4, e5, e6, e7); - Vector128 SoftwareFallback(short i0, short i1, short i2, short i3, short i4, short i5, short i6, short i7) + static Vector128 SoftwareFallback(short e0, short e1, short e2, short e3, short e4, short e5, short e6, short e7) { var pResult = stackalloc short[8] { - i0, - i1, - i2, - i3, - i4, - i5, - i6, - i7, + e0, + e1, + e2, + e3, + e4, + e5, + e6, + e7, }; return Unsafe.AsRef>(pResult); @@ -790,14 +790,14 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3); - Vector128 SoftwareFallback(int i0, int i1, int i2, int i3) + static Vector128 SoftwareFallback(int e0, int e1, int e2, int e3) { var pResult = stackalloc int[4] { - i0, - i1, - i2, - i3, + e0, + e1, + e2, + e3, }; return Unsafe.AsRef>(pResult); @@ -824,12 +824,12 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1); - Vector128 SoftwareFallback(long i0, long i1) + static Vector128 SoftwareFallback(long e0, long e1) { var pResult = stackalloc long[2] { - i0, - i1, + e0, + e1, }; return Unsafe.AsRef>(pResult); @@ -913,26 +913,26 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15); - Vector128 SoftwareFallback(sbyte i0, sbyte i1, sbyte i2, sbyte i3, sbyte i4, sbyte i5, sbyte i6, sbyte i7, sbyte i8, sbyte i9, sbyte i10, sbyte i11, sbyte i12, sbyte i13, sbyte i14, sbyte i15) + static Vector128 SoftwareFallback(sbyte e0, sbyte e1, sbyte e2, sbyte e3, sbyte e4, sbyte e5, sbyte e6, sbyte e7, sbyte e8, sbyte e9, sbyte e10, sbyte e11, sbyte e12, sbyte e13, sbyte e14, sbyte e15) { var pResult = stackalloc sbyte[16] { - i0, - i1, - i2, - i3, - i4, - i5, - i6, - i7, - i8, - i9, - i10, - i11, - i12, - i13, - i14, - i15, + e0, + e1, + e2, + e3, + e4, + e5, + e6, + e7, + e8, + e9, + e10, + e11, + e12, + e13, + e14, + e15, }; return Unsafe.AsRef>(pResult); @@ -966,14 +966,14 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3); - Vector128 SoftwareFallback(float i0, float i1, float i2, float i3) + static Vector128 SoftwareFallback(float e0, float e1, float e2, float e3) { var pResult = stackalloc float[4] { - i0, - i1, - i2, - i3, + e0, + e1, + e2, + e3, }; return Unsafe.AsRef>(pResult); @@ -1008,18 +1008,18 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3, e4, e5, e6, e7); - Vector128 SoftwareFallback(ushort i0, ushort i1, ushort i2, ushort i3, ushort i4, ushort i5, ushort i6, ushort i7) + static Vector128 SoftwareFallback(ushort e0, ushort e1, ushort e2, ushort e3, ushort e4, ushort e5, ushort e6, ushort e7) { var pResult = stackalloc ushort[8] { - i0, - i1, - i2, - i3, - i4, - i5, - i6, - i7, + e0, + e1, + e2, + e3, + e4, + e5, + e6, + e7, }; return Unsafe.AsRef>(pResult); @@ -1057,14 +1057,14 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3); - Vector128 SoftwareFallback(uint i0, uint i1, uint i2, uint i3) + static Vector128 SoftwareFallback(uint e0, uint e1, uint e2, uint e3) { var pResult = stackalloc uint[4] { - i0, - i1, - i2, - i3, + e0, + e1, + e2, + e3, }; return Unsafe.AsRef>(pResult); @@ -1092,12 +1092,12 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1); - Vector128 SoftwareFallback(ulong i0, ulong i1) + static Vector128 SoftwareFallback(ulong e0, ulong e1) { var pResult = stackalloc ulong[2] { - i0, - i1, + e0, + e1, }; return Unsafe.AsRef>(pResult); @@ -1273,10 +1273,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(byte x) + static Vector128 SoftwareFallback(byte value) { var result = Vector128.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1294,10 +1294,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(double x) + static Vector128 SoftwareFallback(double value) { var result = Vector128.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1317,10 +1317,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(short x) + static Vector128 SoftwareFallback(short value) { var result = Vector128.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1338,10 +1338,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(int x) + static Vector128 SoftwareFallback(int value) { var result = Vector128.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1358,10 +1358,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(long x) + static Vector128 SoftwareFallback(long value) { var result = Vector128.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1382,10 +1382,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(sbyte x) + static Vector128 SoftwareFallback(sbyte value) { var result = Vector128.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1403,10 +1403,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(float x) + static Vector128 SoftwareFallback(float value) { var result = Vector128.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1427,10 +1427,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(ushort x) + static Vector128 SoftwareFallback(ushort value) { var result = Vector128.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1449,10 +1449,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(uint x) + static Vector128 SoftwareFallback(uint value) { var result = Vector128.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1471,10 +1471,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector128 SoftwareFallback(ulong x) + static Vector128 SoftwareFallback(ulong value) { var result = Vector128.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128_1.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128_1.cs index 424e40a..7060504 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128_1.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector128_1.cs @@ -204,11 +204,11 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(in this, other); - bool SoftwareFallback(in Vector128 x, Vector128 y) + static bool SoftwareFallback(in Vector128 vector, Vector128 other) { for (int i = 0; i < Count; i++) { - if (!((IEquatable)(x.GetElement(i))).Equals(y.GetElement(i))) + if (!((IEquatable)(vector.GetElement(i))).Equals(other.GetElement(i))) { return false; } diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256.cs index e934b9a..1af31dc 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256.cs @@ -191,42 +191,42 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(byte x) + static Vector256 SoftwareFallback(byte value) { var pResult = stackalloc byte[32] { - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -253,14 +253,14 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(double x) + static Vector256 SoftwareFallback(double value) { var pResult = stackalloc double[4] { - x, - x, - x, - x, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -287,26 +287,26 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(short x) + static Vector256 SoftwareFallback(short value) { var pResult = stackalloc short[16] { - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -333,18 +333,18 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(int x) + static Vector256 SoftwareFallback(int value) { var pResult = stackalloc int[8] { - x, - x, - x, - x, - x, - x, - x, - x, + value, + value, + value, + value, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -373,14 +373,14 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(long x) + static Vector256 SoftwareFallback(long value) { var pResult = stackalloc long[4] { - x, - x, - x, - x, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -408,42 +408,42 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(sbyte x) + static Vector256 SoftwareFallback(sbyte value) { var pResult = stackalloc sbyte[32] { - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -470,18 +470,18 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(float x) + static Vector256 SoftwareFallback(float value) { var pResult = stackalloc float[8] { - x, - x, - x, - x, - x, - x, - x, - x, + value, + value, + value, + value, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -509,26 +509,26 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(ushort x) + static Vector256 SoftwareFallback(ushort value) { var pResult = stackalloc ushort[16] { - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, - x, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -556,18 +556,18 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(uint x) + static Vector256 SoftwareFallback(uint value) { var pResult = stackalloc uint[8] { - x, - x, - x, - x, - x, - x, - x, - x, + value, + value, + value, + value, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -597,14 +597,14 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(ulong x) + static Vector256 SoftwareFallback(ulong value) { var pResult = stackalloc ulong[4] { - x, - x, - x, - x, + value, + value, + value, + value, }; return Unsafe.AsRef>(pResult); @@ -657,42 +657,42 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31); - Vector256 SoftwareFallback(byte i0, byte i1, byte i2, byte i3, byte i4, byte i5, byte i6, byte i7, byte i8, byte i9, byte i10, byte i11, byte i12, byte i13, byte i14, byte i15, byte i16, byte i17, byte i18, byte i19, byte i20, byte i21, byte i22, byte i23, byte i24, byte i25, byte i26, byte i27, byte i28, byte i29, byte i30, byte i31) + static Vector256 SoftwareFallback(byte e0, byte e1, byte e2, byte e3, byte e4, byte e5, byte e6, byte e7, byte e8, byte e9, byte e10, byte e11, byte e12, byte e13, byte e14, byte e15, byte e16, byte e17, byte e18, byte e19, byte e20, byte e21, byte e22, byte e23, byte e24, byte e25, byte e26, byte e27, byte e28, byte e29, byte e30, byte e31) { var pResult = stackalloc byte[32] { - i0, - i1, - i2, - i3, - i4, - i5, - i6, - i7, - i8, - i9, - i10, - i11, - i12, - i13, - i14, - i15, - i16, - i17, - i18, - i19, - i20, - i21, - i22, - i23, - i24, - i25, - i26, - i27, - i28, - i29, - i30, - i31, + e0, + e1, + e2, + e3, + e4, + e5, + e6, + e7, + e8, + e9, + e10, + e11, + e12, + e13, + e14, + e15, + e16, + e17, + e18, + e19, + e20, + e21, + e22, + e23, + e24, + e25, + e26, + e27, + e28, + e29, + e30, + e31, }; return Unsafe.AsRef>(pResult); @@ -717,14 +717,14 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3); - Vector256 SoftwareFallback(double i0, double i1, double i2, double i3) + static Vector256 SoftwareFallback(double e0, double e1, double e2, double e3) { var pResult = stackalloc double[4] { - i0, - i1, - i2, - i3, + e0, + e1, + e2, + e3, }; return Unsafe.AsRef>(pResult); @@ -761,26 +761,26 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15); - Vector256 SoftwareFallback(short i0, short i1, short i2, short i3, short i4, short i5, short i6, short i7, short i8, short i9, short i10, short i11, short i12, short i13, short i14, short i15) + static Vector256 SoftwareFallback(short e0, short e1, short e2, short e3, short e4, short e5, short e6, short e7, short e8, short e9, short e10, short e11, short e12, short e13, short e14, short e15) { var pResult = stackalloc short[16] { - i0, - i1, - i2, - i3, - i4, - i5, - i6, - i7, - i8, - i9, - i10, - i11, - i12, - i13, - i14, - i15, + e0, + e1, + e2, + e3, + e4, + e5, + e6, + e7, + e8, + e9, + e10, + e11, + e12, + e13, + e14, + e15, }; return Unsafe.AsRef>(pResult); @@ -809,18 +809,18 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3, e4, e5, e6, e7); - Vector256 SoftwareFallback(int i0, int i1, int i2, int i3, int i4, int i5, int i6, int i7) + static Vector256 SoftwareFallback(int e0, int e1, int e2, int e3, int e4, int e5, int e6, int e7) { var pResult = stackalloc int[8] { - i0, - i1, - i2, - i3, - i4, - i5, - i6, - i7, + e0, + e1, + e2, + e3, + e4, + e5, + e6, + e7, }; return Unsafe.AsRef>(pResult); @@ -845,14 +845,14 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3); - Vector256 SoftwareFallback(long i0, long i1, long i2, long i3) + static Vector256 SoftwareFallback(long e0, long e1, long e2, long e3) { var pResult = stackalloc long[4] { - i0, - i1, - i2, - i3, + e0, + e1, + e2, + e3, }; return Unsafe.AsRef>(pResult); @@ -906,42 +906,42 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15, e16, e17, e18, e19, e20, e21, e22, e23, e24, e25, e26, e27, e28, e29, e30, e31); - Vector256 SoftwareFallback(sbyte i0, sbyte i1, sbyte i2, sbyte i3, sbyte i4, sbyte i5, sbyte i6, sbyte i7, sbyte i8, sbyte i9, sbyte i10, sbyte i11, sbyte i12, sbyte i13, sbyte i14, sbyte i15, sbyte i16, sbyte i17, sbyte i18, sbyte i19, sbyte i20, sbyte i21, sbyte i22, sbyte i23, sbyte i24, sbyte i25, sbyte i26, sbyte i27, sbyte i28, sbyte i29, sbyte i30, sbyte i31) + static Vector256 SoftwareFallback(sbyte e0, sbyte e1, sbyte e2, sbyte e3, sbyte e4, sbyte e5, sbyte e6, sbyte e7, sbyte e8, sbyte e9, sbyte e10, sbyte e11, sbyte e12, sbyte e13, sbyte e14, sbyte e15, sbyte e16, sbyte e17, sbyte e18, sbyte e19, sbyte e20, sbyte e21, sbyte e22, sbyte e23, sbyte e24, sbyte e25, sbyte e26, sbyte e27, sbyte e28, sbyte e29, sbyte e30, sbyte e31) { var pResult = stackalloc sbyte[32] { - i0, - i1, - i2, - i3, - i4, - i5, - i6, - i7, - i8, - i9, - i10, - i11, - i12, - i13, - i14, - i15, - i16, - i17, - i18, - i19, - i20, - i21, - i22, - i23, - i24, - i25, - i26, - i27, - i28, - i29, - i30, - i31, + e0, + e1, + e2, + e3, + e4, + e5, + e6, + e7, + e8, + e9, + e10, + e11, + e12, + e13, + e14, + e15, + e16, + e17, + e18, + e19, + e20, + e21, + e22, + e23, + e24, + e25, + e26, + e27, + e28, + e29, + e30, + e31, }; return Unsafe.AsRef>(pResult); @@ -970,18 +970,18 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3, e4, e5, e6, e7); - Vector256 SoftwareFallback(float i0, float i1, float i2, float i3, float i4, float i5, float i6, float i7) + static Vector256 SoftwareFallback(float e0, float e1, float e2, float e3, float e4, float e5, float e6, float e7) { var pResult = stackalloc float[8] { - i0, - i1, - i2, - i3, - i4, - i5, - i6, - i7, + e0, + e1, + e2, + e3, + e4, + e5, + e6, + e7, }; return Unsafe.AsRef>(pResult); @@ -1019,26 +1019,26 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, e10, e11, e12, e13, e14, e15); - Vector256 SoftwareFallback(ushort i0, ushort i1, ushort i2, ushort i3, ushort i4, ushort i5, ushort i6, ushort i7, ushort i8, ushort i9, ushort i10, ushort i11, ushort i12, ushort i13, ushort i14, ushort i15) + static Vector256 SoftwareFallback(ushort e0, ushort e1, ushort e2, ushort e3, ushort e4, ushort e5, ushort e6, ushort e7, ushort e8, ushort e9, ushort e10, ushort e11, ushort e12, ushort e13, ushort e14, ushort e15) { var pResult = stackalloc ushort[16] { - i0, - i1, - i2, - i3, - i4, - i5, - i6, - i7, - i8, - i9, - i10, - i11, - i12, - i13, - i14, - i15, + e0, + e1, + e2, + e3, + e4, + e5, + e6, + e7, + e8, + e9, + e10, + e11, + e12, + e13, + e14, + e15, }; return Unsafe.AsRef>(pResult); @@ -1068,18 +1068,18 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3, e4, e5, e6, e7); - Vector256 SoftwareFallback(uint i0, uint i1, uint i2, uint i3, uint i4, uint i5, uint i6, uint i7) + static Vector256 SoftwareFallback(uint e0, uint e1, uint e2, uint e3, uint e4, uint e5, uint e6, uint e7) { var pResult = stackalloc uint[8] { - i0, - i1, - i2, - i3, - i4, - i5, - i6, - i7, + e0, + e1, + e2, + e3, + e4, + e5, + e6, + e7, }; return Unsafe.AsRef>(pResult); @@ -1105,14 +1105,14 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(e0, e1, e2, e3); - Vector256 SoftwareFallback(ulong i0, ulong i1, ulong i2, ulong i3) + static Vector256 SoftwareFallback(ulong e0, ulong e1, ulong e2, ulong e3) { var pResult = stackalloc ulong[4] { - i0, - i1, - i2, - i3, + e0, + e1, + e2, + e3, }; return Unsafe.AsRef>(pResult); @@ -1134,13 +1134,13 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(lower, upper); - Vector256 SoftwareFallback(Vector128 x, Vector128 y) + static Vector256 SoftwareFallback(Vector128 lower, Vector128 upper) { Vector256 result256 = Vector256.Zero; ref Vector128 result128 = ref Unsafe.As, Vector128>(ref result256); - result128 = x; - Unsafe.Add(ref result128, 1) = y; + result128 = lower; + Unsafe.Add(ref result128, 1) = upper; return result256; } @@ -1161,13 +1161,13 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(lower, upper); - Vector256 SoftwareFallback(Vector128 x, Vector128 y) + static Vector256 SoftwareFallback(Vector128 lower, Vector128 upper) { Vector256 result256 = Vector256.Zero; ref Vector128 result128 = ref Unsafe.As, Vector128>(ref result256); - result128 = x; - Unsafe.Add(ref result128, 1) = y; + result128 = lower; + Unsafe.Add(ref result128, 1) = upper; return result256; } @@ -1188,13 +1188,13 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(lower, upper); - Vector256 SoftwareFallback(Vector128 x, Vector128 y) + static Vector256 SoftwareFallback(Vector128 lower, Vector128 upper) { Vector256 result256 = Vector256.Zero; ref Vector128 result128 = ref Unsafe.As, Vector128>(ref result256); - result128 = x; - Unsafe.Add(ref result128, 1) = y; + result128 = lower; + Unsafe.Add(ref result128, 1) = upper; return result256; } @@ -1215,13 +1215,13 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(lower, upper); - Vector256 SoftwareFallback(Vector128 x, Vector128 y) + static Vector256 SoftwareFallback(Vector128 lower, Vector128 upper) { Vector256 result256 = Vector256.Zero; ref Vector128 result128 = ref Unsafe.As, Vector128>(ref result256); - result128 = x; - Unsafe.Add(ref result128, 1) = y; + result128 = lower; + Unsafe.Add(ref result128, 1) = upper; return result256; } @@ -1242,13 +1242,13 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(lower, upper); - Vector256 SoftwareFallback(Vector128 x, Vector128 y) + static Vector256 SoftwareFallback(Vector128 lower, Vector128 upper) { Vector256 result256 = Vector256.Zero; ref Vector128 result128 = ref Unsafe.As, Vector128>(ref result256); - result128 = x; - Unsafe.Add(ref result128, 1) = y; + result128 = lower; + Unsafe.Add(ref result128, 1) = upper; return result256; } @@ -1270,13 +1270,13 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(lower, upper); - Vector256 SoftwareFallback(Vector128 x, Vector128 y) + static Vector256 SoftwareFallback(Vector128 lower, Vector128 upper) { Vector256 result256 = Vector256.Zero; ref Vector128 result128 = ref Unsafe.As, Vector128>(ref result256); - result128 = x; - Unsafe.Add(ref result128, 1) = y; + result128 = lower; + Unsafe.Add(ref result128, 1) = upper; return result256; } @@ -1297,13 +1297,13 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(lower, upper); - Vector256 SoftwareFallback(Vector128 x, Vector128 y) + static Vector256 SoftwareFallback(Vector128 lower, Vector128 upper) { Vector256 result256 = Vector256.Zero; ref Vector128 result128 = ref Unsafe.As, Vector128>(ref result256); - result128 = x; - Unsafe.Add(ref result128, 1) = y; + result128 = lower; + Unsafe.Add(ref result128, 1) = upper; return result256; } @@ -1325,13 +1325,13 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(lower, upper); - Vector256 SoftwareFallback(Vector128 x, Vector128 y) + static Vector256 SoftwareFallback(Vector128 lower, Vector128 upper) { Vector256 result256 = Vector256.Zero; ref Vector128 result128 = ref Unsafe.As, Vector128>(ref result256); - result128 = x; - Unsafe.Add(ref result128, 1) = y; + result128 = lower; + Unsafe.Add(ref result128, 1) = upper; return result256; } @@ -1353,13 +1353,13 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(lower, upper); - Vector256 SoftwareFallback(Vector128 x, Vector128 y) + static Vector256 SoftwareFallback(Vector128 lower, Vector128 upper) { Vector256 result256 = Vector256.Zero; ref Vector128 result128 = ref Unsafe.As, Vector128>(ref result256); - result128 = x; - Unsafe.Add(ref result128, 1) = y; + result128 = lower; + Unsafe.Add(ref result128, 1) = upper; return result256; } @@ -1381,13 +1381,13 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(lower, upper); - Vector256 SoftwareFallback(Vector128 x, Vector128 y) + static Vector256 SoftwareFallback(Vector128 lower, Vector128 upper) { Vector256 result256 = Vector256.Zero; ref Vector128 result128 = ref Unsafe.As, Vector128>(ref result256); - result128 = x; - Unsafe.Add(ref result128, 1) = y; + result128 = lower; + Unsafe.Add(ref result128, 1) = upper; return result256; } @@ -1406,10 +1406,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(byte x) + static Vector256 SoftwareFallback(byte value) { var result = Vector256.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1427,10 +1427,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(double x) + static Vector256 SoftwareFallback(double value) { var result = Vector256.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1448,10 +1448,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(short x) + static Vector256 SoftwareFallback(short value) { var result = Vector256.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1469,10 +1469,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(int x) + static Vector256 SoftwareFallback(int value) { var result = Vector256.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1490,10 +1490,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(long x) + static Vector256 SoftwareFallback(long value) { var result = Vector256.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1512,10 +1512,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(sbyte x) + static Vector256 SoftwareFallback(sbyte value) { var result = Vector256.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1533,10 +1533,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(float x) + static Vector256 SoftwareFallback(float value) { var result = Vector256.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1555,10 +1555,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(ushort x) + static Vector256 SoftwareFallback(ushort value) { var result = Vector256.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1577,10 +1577,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(uint x) + static Vector256 SoftwareFallback(uint value) { var result = Vector256.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } @@ -1599,10 +1599,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(value); - Vector256 SoftwareFallback(ulong x) + static Vector256 SoftwareFallback(ulong value) { var result = Vector256.Zero; - Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), x); + Unsafe.WriteUnaligned(ref Unsafe.As, byte>(ref result), value); return result; } } diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256_1.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256_1.cs index ba87fb2..61191cc 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256_1.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/Vector256_1.cs @@ -205,11 +205,11 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(in this, other); - bool SoftwareFallback(in Vector256 x, Vector256 y) + static bool SoftwareFallback(in Vector256 vector, Vector256 other) { for (int i = 0; i < Count; i++) { - if (!((IEquatable)(x.GetElement(i))).Equals(y.GetElement(i))) + if (!((IEquatable)(vector.GetElement(i))).Equals(other.GetElement(i))) { return false; } @@ -318,10 +318,10 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(in this, value); - Vector256 SoftwareFallback(in Vector256 t, Vector128 x) + static Vector256 SoftwareFallback(in Vector256 vector, Vector128 value) { - Vector256 result = t; - Unsafe.As, Vector128>(ref result) = x; + Vector256 result = vector; + Unsafe.As, Vector128>(ref result) = value; return result; } } @@ -349,9 +349,9 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(in this); - Vector128 SoftwareFallback(in Vector256 t) + static Vector128 SoftwareFallback(in Vector256 vector) { - ref Vector128 lower = ref Unsafe.As, Vector128>(ref Unsafe.AsRef(in t)); + ref Vector128 lower = ref Unsafe.As, Vector128>(ref Unsafe.AsRef(in vector)); return Unsafe.Add(ref lower, 1); } } @@ -380,11 +380,11 @@ namespace System.Runtime.Intrinsics return SoftwareFallback(in this, value); - Vector256 SoftwareFallback(in Vector256 t, Vector128 x) + static Vector256 SoftwareFallback(in Vector256 vector, Vector128 value) { - Vector256 result = t; + Vector256 result = vector; ref Vector128 lower = ref Unsafe.As, Vector128>(ref result); - Unsafe.Add(ref lower, 1) = x; + Unsafe.Add(ref lower, 1) = value; return result; } } -- 2.7.4