diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Avx.PlatformNotSupported.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Avx.PlatformNotSupported.cs index 1fd61ec3e1e1..f1164d41eea6 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Avx.PlatformNotSupported.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Avx.PlatformNotSupported.cs @@ -238,22 +238,22 @@ public static class Avx /// __int8 _mm256_extract_epi8 (__m256i a, const int index) /// HELPER /// - public static sbyte Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); } + public static int Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); } /// /// __int8 _mm256_extract_epi8 (__m256i a, const int index) /// HELPER /// - public static byte Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); } + public static uint Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); } /// /// __int16 _mm256_extract_epi16 (__m256i a, const int index) /// HELPER /// - public static short Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); } + public static int Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); } /// /// __int16 _mm256_extract_epi16 (__m256i a, const int index) /// HELPER /// - public static ushort Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); } + public static uint Extract(Vector256 value, byte index) { throw new PlatformNotSupportedException(); } /// /// __int32 _mm256_extract_epi32 (__m256i a, const int index) /// HELPER @@ -638,45 +638,45 @@ public static class Avx /// __m128 _mm_maskload_ps (float const * mem_addr, __m128i mask) /// VMASKMOVPS xmm, xmm, m128 /// - public static unsafe Vector128 MaskLoad(float* address, Vector128 mask) { throw new PlatformNotSupportedException(); } + public static unsafe Vector128 MaskLoad(float* address, Vector128 mask) { throw new PlatformNotSupportedException(); } /// /// __m128d _mm_maskload_pd (double const * mem_addr, __m128i mask) /// VMASKMOVPD xmm, xmm, m128 /// - public static unsafe Vector128 MaskLoad(double* address, Vector128 mask) { throw new PlatformNotSupportedException(); } + public static unsafe Vector128 MaskLoad(double* address, Vector128 mask) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_maskload_ps (float const * mem_addr, __m256i mask) /// VMASKMOVPS ymm, ymm, m256 /// - public static unsafe Vector256 MaskLoad(float* address, Vector256 mask) { throw new PlatformNotSupportedException(); } + public static unsafe Vector256 MaskLoad(float* address, Vector256 mask) { throw new PlatformNotSupportedException(); } /// /// __m256d _mm256_maskload_pd (double const * mem_addr, __m256i mask) /// VMASKMOVPD ymm, ymm, m256 /// - public static unsafe Vector256 MaskLoad(double* address, Vector256 mask) { throw new PlatformNotSupportedException(); } + public static unsafe Vector256 MaskLoad(double* address, Vector256 mask) { throw new PlatformNotSupportedException(); } /// /// void _mm_maskstore_ps (float * mem_addr, __m128i mask, __m128 a) /// VMASKMOVPS m128, xmm, xmm /// - public static unsafe void MaskStore(float* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } + public static unsafe void MaskStore(float* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm_maskstore_pd (double * mem_addr, __m128i mask, __m128d a) /// VMASKMOVPD m128, xmm, xmm /// - public static unsafe void MaskStore(double* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } + public static unsafe void MaskStore(double* address, Vector128 mask, Vector128 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_maskstore_ps (float * mem_addr, __m256i mask, __m256 a) /// VMASKMOVPS m256, ymm, ymm /// - public static unsafe void MaskStore(float* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } + public static unsafe void MaskStore(float* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// void _mm256_maskstore_pd (double * mem_addr, __m256i mask, __m256d a) /// VMASKMOVPD m256, ymm, ymm /// - public static unsafe void MaskStore(double* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } + public static unsafe void MaskStore(double* address, Vector256 mask, Vector256 source) { throw new PlatformNotSupportedException(); } /// /// __m256 _mm256_max_ps (__m256 a, __m256 b) diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Avx.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Avx.cs index fdb349b120ee..c7779dbb2b81 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Avx.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Avx.cs @@ -239,14 +239,14 @@ public static class Avx /// __int8 _mm256_extract_epi8 (__m256i a, const int index) /// HELPER /// - public static sbyte Extract(Vector256 value, byte index) + public static int Extract(Vector256 value, byte index) { unsafe { index &= 0x1F; sbyte* buffer = stackalloc sbyte[32]; Store(buffer, value); - return buffer[index]; + return (int)buffer[index]; } } @@ -254,14 +254,14 @@ public static sbyte Extract(Vector256 value, byte index) /// __int8 _mm256_extract_epi8 (__m256i a, const int index) /// HELPER /// - public static byte Extract(Vector256 value, byte index) + public static uint Extract(Vector256 value, byte index) { unsafe { index &= 0x1F; byte* buffer = stackalloc byte[32]; Store(buffer, value); - return buffer[index]; + return (uint)buffer[index]; } } @@ -269,14 +269,14 @@ public static byte Extract(Vector256 value, byte index) /// __int16 _mm256_extract_epi16 (__m256i a, const int index) /// HELPER /// - public static short Extract(Vector256 value, byte index) + public static int Extract(Vector256 value, byte index) { unsafe { index &= 0xF; short* buffer = stackalloc short[16]; Store(buffer, value); - return buffer[index]; + return (int)buffer[index]; } } @@ -284,14 +284,14 @@ public static short Extract(Vector256 value, byte index) /// __int16 _mm256_extract_epi16 (__m256i a, const int index) /// HELPER /// - public static ushort Extract(Vector256 value, byte index) + public static uint Extract(Vector256 value, byte index) { unsafe { index &= 0xF; ushort* buffer = stackalloc ushort[16]; Store(buffer, value); - return buffer[index]; + return (uint)buffer[index]; } } @@ -825,45 +825,45 @@ public static Vector256 InsertVector128(Vector256 value, Vector128 d /// __m128 _mm_maskload_ps (float const * mem_addr, __m128i mask) /// VMASKMOVPS xmm, xmm, m128 /// - public static unsafe Vector128 MaskLoad(float* address, Vector128 mask) => MaskLoad(address, mask); + public static unsafe Vector128 MaskLoad(float* address, Vector128 mask) => MaskLoad(address, mask); /// /// __m128d _mm_maskload_pd (double const * mem_addr, __m128i mask) /// VMASKMOVPD xmm, xmm, m128 /// - public static unsafe Vector128 MaskLoad(double* address, Vector128 mask) => MaskLoad(address, mask); + public static unsafe Vector128 MaskLoad(double* address, Vector128 mask) => MaskLoad(address, mask); /// /// __m256 _mm256_maskload_ps (float const * mem_addr, __m256i mask) /// VMASKMOVPS ymm, ymm, m256 /// - public static unsafe Vector256 MaskLoad(float* address, Vector256 mask) => MaskLoad(address, mask); + public static unsafe Vector256 MaskLoad(float* address, Vector256 mask) => MaskLoad(address, mask); /// /// __m256d _mm256_maskload_pd (double const * mem_addr, __m256i mask) /// VMASKMOVPD ymm, ymm, m256 /// - public static unsafe Vector256 MaskLoad(double* address, Vector256 mask) => MaskLoad(address, mask); + public static unsafe Vector256 MaskLoad(double* address, Vector256 mask) => MaskLoad(address, mask); /// /// void _mm_maskstore_ps (float * mem_addr, __m128i mask, __m128 a) /// VMASKMOVPS m128, xmm, xmm /// - public static unsafe void MaskStore(float* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + public static unsafe void MaskStore(float* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm_maskstore_pd (double * mem_addr, __m128i mask, __m128d a) /// VMASKMOVPD m128, xmm, xmm /// - public static unsafe void MaskStore(double* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); + public static unsafe void MaskStore(double* address, Vector128 mask, Vector128 source) => MaskStore(address, mask, source); /// /// void _mm256_maskstore_ps (float * mem_addr, __m256i mask, __m256 a) /// VMASKMOVPS m256, ymm, ymm /// - public static unsafe void MaskStore(float* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + public static unsafe void MaskStore(float* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// void _mm256_maskstore_pd (double * mem_addr, __m256i mask, __m256d a) /// VMASKMOVPD m256, ymm, ymm /// - public static unsafe void MaskStore(double* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); + public static unsafe void MaskStore(double* address, Vector256 mask, Vector256 source) => MaskStore(address, mask, source); /// /// __m256 _mm256_max_ps (__m256 a, __m256 b) diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse2.PlatformNotSupported.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse2.PlatformNotSupported.cs index 8aaa454eebca..17d155389441 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse2.PlatformNotSupported.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse2.PlatformNotSupported.cs @@ -613,12 +613,12 @@ public static class Sse2 /// int _mm_extract_epi16 (__m128i a, int immediate) /// PEXTRW reg, xmm, imm8 /// - public static short Extract(Vector128 value, byte index) { throw new PlatformNotSupportedException(); } + public static int Extract(Vector128 value, byte index) { throw new PlatformNotSupportedException(); } /// /// int _mm_extract_epi16 (__m128i a, int immediate) /// PEXTRW reg, xmm, imm8 /// - public static ushort Extract(Vector128 value, byte index) { throw new PlatformNotSupportedException(); } + public static uint Extract(Vector128 value, byte index) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_insert_epi16 (__m128i a, int i, int immediate) diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse2.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse2.cs index d0eb9ef4da9b..796aef52f352 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse2.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse2.cs @@ -614,12 +614,12 @@ public static class Sse2 /// int _mm_extract_epi16 (__m128i a, int immediate) /// PEXTRW reg, xmm, imm8 /// - public static short Extract(Vector128 value, byte index) => Extract(value, index); + public static int Extract(Vector128 value, byte index) => Extract(value, index); /// /// int _mm_extract_epi16 (__m128i a, int immediate) /// PEXTRW reg, xmm, imm8 /// - public static ushort Extract(Vector128 value, byte index) => Extract(value, index); + public static uint Extract(Vector128 value, byte index) => Extract(value, index); /// /// __m128i _mm_insert_epi16 (__m128i a, int i, int immediate) diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse41.PlatformNotSupported.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse41.PlatformNotSupported.cs index 063b8dc2cbf7..ae501aedf771 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse41.PlatformNotSupported.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse41.PlatformNotSupported.cs @@ -182,12 +182,12 @@ public static class Sse41 /// int _mm_extract_epi8 (__m128i a, const int imm8) /// PEXTRB reg/m8, xmm, imm8 /// - public static sbyte Extract(Vector128 value, byte index) { throw new PlatformNotSupportedException(); } + public static int Extract(Vector128 value, byte index) { throw new PlatformNotSupportedException(); } /// /// int _mm_extract_epi8 (__m128i a, const int imm8) /// PEXTRB reg/m8, xmm, imm8 /// - public static byte Extract(Vector128 value, byte index) { throw new PlatformNotSupportedException(); } + public static uint Extract(Vector128 value, byte index) { throw new PlatformNotSupportedException(); } /// /// int _mm_extract_epi32 (__m128i a, const int imm8) /// PEXTRD reg/m32, xmm, imm8 @@ -283,7 +283,7 @@ public static class Sse41 /// __m128 _mm_insert_ps (__m128 a, __m128 b, const int imm8) /// INSERTPS xmm, xmm/m32, imm8 /// - public static Vector128 Insert(Vector128 value, float data, byte index) { throw new PlatformNotSupportedException(); } + public static Vector128 Insert(Vector128 value, Vector128 data, byte index) { throw new PlatformNotSupportedException(); } /// /// __m128i _mm_max_epi8 (__m128i a, __m128i b) diff --git a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse41.cs b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse41.cs index dd81168a2450..fb28bfea0aa8 100644 --- a/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse41.cs +++ b/src/System.Private.CoreLib/shared/System/Runtime/Intrinsics/X86/Sse41.cs @@ -182,12 +182,12 @@ public static class Sse41 /// int _mm_extract_epi8 (__m128i a, const int imm8) /// PEXTRB reg/m8, xmm, imm8 /// - public static sbyte Extract(Vector128 value, byte index) => Extract(value, index); + public static int Extract(Vector128 value, byte index) => Extract(value, index); /// /// int _mm_extract_epi8 (__m128i a, const int imm8) /// PEXTRB reg/m8, xmm, imm8 /// - public static byte Extract(Vector128 value, byte index) => Extract(value, index); + public static uint Extract(Vector128 value, byte index) => Extract(value, index); /// /// int _mm_extract_epi32 (__m128i a, const int imm8) /// PEXTRD reg/m32, xmm, imm8 @@ -283,7 +283,7 @@ public static class Sse41 /// __m128 _mm_insert_ps (__m128 a, __m128 b, const int imm8) /// INSERTPS xmm, xmm/m32, imm8 /// - public static Vector128 Insert(Vector128 value, float data, byte index) => Insert(value, data, index); + public static Vector128 Insert(Vector128 value, Vector128 data, byte index) => Insert(value, data, index); /// /// __m128i _mm_max_epi8 (__m128i a, __m128i b) diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Avx/MaskLoad_r.csproj b/tests/src/JIT/HardwareIntrinsics/X86/Avx/MaskLoad_r.csproj deleted file mode 100644 index a35fbf8f8af8..000000000000 --- a/tests/src/JIT/HardwareIntrinsics/X86/Avx/MaskLoad_r.csproj +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - Exe - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - ..\..\ - true - - - - - - - False - - - - None - - - - - - - - - - - diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Avx/MaskLoad_ro.csproj b/tests/src/JIT/HardwareIntrinsics/X86/Avx/MaskLoad_ro.csproj deleted file mode 100644 index d0a0a9c518c5..000000000000 --- a/tests/src/JIT/HardwareIntrinsics/X86/Avx/MaskLoad_ro.csproj +++ /dev/null @@ -1,34 +0,0 @@ - - - - - Debug - AnyCPU - 2.0 - {95DFC527-4DC1-495E-97D7-E94EE1F7140D} - Exe - {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - ..\..\ - true - - - - - - - False - - - - None - True - - - - - - - - - - diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Shared/GenerateTests.csx b/tests/src/JIT/HardwareIntrinsics/X86/Shared/GenerateTests.csx index e8f44cde1889..08d5da8a9d80 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Shared/GenerateTests.csx +++ b/tests/src/JIT/HardwareIntrinsics/X86/Shared/GenerateTests.csx @@ -301,30 +301,18 @@ private static readonly (string templateFileName, Dictionary tem ("SimpleUnOpTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse", ["Method"] = "Floor", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Floor(firstOp[0]))", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(MathF.Floor(firstOp[i]))"}), ("SimpleBinOpTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "FloorScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Double", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Double", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Double", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(double)(random.NextDouble())", ["NextValueOp2"] = "(double)(random.NextDouble())", ["ValidateFirstResult"] = "BitConverter.DoubleToInt64Bits(result[0]) != BitConverter.DoubleToInt64Bits(Math.Floor(right[0]))", ["ValidateRemainingResults"] = "BitConverter.DoubleToInt64Bits(result[i]) != BitConverter.DoubleToInt64Bits(left[i])"}), ("SimpleBinOpTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse", ["Method"] = "FloorScalar", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Single", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())", ["NextValueOp2"] = "(float)(random.NextDouble())", ["ValidateFirstResult"] = "BitConverter.SingleToInt32Bits(result[0]) != BitConverter.SingleToInt32Bits(MathF.Floor(right[0]))", ["ValidateRemainingResults"] = "BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(left[i])"}), - ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Data"] = "(float)2", ["Imm"] = "0", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())", ["ValidateFirstResult"] = "(i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))"}), ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Byte", ["Data"] = "(byte)2", ["Imm"] = "1", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(byte)(random.Next(0, byte.MaxValue))", ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}), ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "SByte", ["Data"] = "(sbyte)2", ["Imm"] = "1", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(sbyte)(random.Next(0, sbyte.MaxValue))", ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}), ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Int32", ["Data"] = "(int)2", ["Imm"] = "1", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(int)(random.Next(0, int.MaxValue))", ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}), ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "UInt32", ["Data"] = "(uint)2", ["Imm"] = "1", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(uint)(random.Next(0, int.MaxValue))", ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}), ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Int64", ["Data"] = "(long)2", ["Imm"] = "1", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(long)(random.Next(0, int.MaxValue))", ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}), ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "UInt64", ["Data"] = "(ulong)2", ["Imm"] = "1", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(ulong)(random.Next(0, int.MaxValue))", ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}), - ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Data"] = "(float)2", ["Imm"] = "1", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())", ["ValidateFirstResult"] = "(i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))"}), - ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Data"] = "(float)2", ["Imm"] = "2", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())", ["ValidateFirstResult"] = "(i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : i == 1 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))"}), - ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Data"] = "(float)2", ["Imm"] = "4", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())", ["ValidateFirstResult"] = "(i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : i == 2 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))"}), - ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Data"] = "(float)2", ["Imm"] = "8", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())", ["ValidateFirstResult"] = "(i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : i == 3 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))"}), - ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Data"] = "(float)2", ["Imm"] = "16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())", ["ValidateFirstResult"] = "(i == 1 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))"}), - ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Data"] = "(float)2", ["Imm"] = "32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())", ["ValidateFirstResult"] = "(i == 2 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))"}), - ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Data"] = "(float)2", ["Imm"] = "48", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())", ["ValidateFirstResult"] = "(i == 3 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))"}), - ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Data"] = "(float)2", ["Imm"] = "64", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())", ["ValidateFirstResult"] = "(i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))"}), - ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Data"] = "(float)2", ["Imm"] = "128", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())", ["ValidateFirstResult"] = "(i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))"}), ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Byte", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Byte", ["Data"] = "(byte)2", ["Imm"] = "129", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(byte)(random.Next(0, byte.MaxValue))", ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}), ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "SByte", ["Data"] = "(sbyte)2", ["Imm"] = "129", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(sbyte)(random.Next(0, sbyte.MaxValue))", ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}), ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Int32", ["Data"] = "(int)2", ["Imm"] = "129", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(int)(random.Next(0, int.MaxValue))", ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}), ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt32", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "UInt32", ["Data"] = "(uint)2", ["Imm"] = "129", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(uint)(random.Next(0, int.MaxValue))", ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}), ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int64", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Int64", ["Data"] = "(long)2", ["Imm"] = "129", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(long)(random.Next(0, int.MaxValue))", ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}), ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt64", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "UInt64", ["Data"] = "(ulong)2", ["Imm"] = "129", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(ulong)(random.Next(0, int.MaxValue))", ["ValidateFirstResult"] = "(i == 1 ? result[i] != 2 : result[i] != firstOp[i])"}), - ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Data"] = "(float)2", ["Imm"] = "129", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())", ["ValidateFirstResult"] = "(i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))"}), - ("InsertScalarTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse", ["Method"] = "Insert", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Single", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Single", ["Data"] = "(float)2", ["Imm"] = "192", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(float)(random.NextDouble())", ["ValidateFirstResult"] = "(i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))"}), ("SimpleBinOpTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "Int32", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "Int32", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "Int32", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(int)(random.Next(int.MinValue, int.MaxValue))", ["NextValueOp2"] = "(int)(random.Next(int.MinValue, int.MaxValue))", ["ValidateFirstResult"] = "result[0] != Math.Max(left[0], right[0])", ["ValidateRemainingResults"] = "result[i] != Math.Max(left[i], right[i])"}), ("SimpleBinOpTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "SByte", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "SByte", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "SByte", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", ["NextValueOp2"] = "(sbyte)(random.Next(sbyte.MinValue, sbyte.MaxValue))", ["ValidateFirstResult"] = "result[0] != Math.Max(left[0], right[0])", ["ValidateRemainingResults"] = "result[i] != Math.Max(left[i], right[i])"}), ("SimpleBinOpTest.template", new Dictionary { ["Isa"] = "Sse41", ["LoadIsa"] = "Sse2", ["Method"] = "Max", ["RetVectorType"] = "Vector128", ["RetBaseType"] = "UInt16", ["Op1VectorType"] ="Vector128", ["Op1BaseType"] = "UInt16", ["Op2VectorType"] = "Vector128", ["Op2BaseType"] = "UInt16", ["LargestVectorSize"] = "16", ["NextValueOp1"] = "(ushort)(random.Next(0, ushort.MaxValue))", ["NextValueOp2"] = "(ushort)(random.Next(0, ushort.MaxValue))", ["ValidateFirstResult"] = "result[0] != Math.Max(left[0], right[0])", ["ValidateRemainingResults"] = "result[i] != Math.Max(left[i], right[i])"}), diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.1.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.1.cs deleted file mode 100644 index 537fe667027c..000000000000 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.1.cs +++ /dev/null @@ -1,321 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/****************************************************************************** - * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * - * changes, please update the corresponding template and run according to the * - * directions listed in the file. * - ******************************************************************************/ - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; - -namespace JIT.HardwareIntrinsics.X86 -{ - public static partial class Program - { - private static void InsertSingle1() - { - var test = new SimpleUnaryOpTest__InsertSingle1(); - - try - { - if (test.IsSupported) - { - // Validates basic functionality works, using Unsafe.Read - test.RunBasicScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates basic functionality works, using Load - test.RunBasicScenario_Load(); - - // Validates basic functionality works, using LoadAligned - test.RunBasicScenario_LoadAligned(); - } - - // Validates calling via reflection works, using Unsafe.Read - test.RunReflectionScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates calling via reflection works, using Load - test.RunReflectionScenario_Load(); - - // Validates calling via reflection works, using LoadAligned - test.RunReflectionScenario_LoadAligned(); - } - - // Validates passing a static member works - test.RunClsVarScenario(); - - // Validates passing a local works, using Unsafe.Read - test.RunLclVarScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates passing a local works, using Load - test.RunLclVarScenario_Load(); - - // Validates passing a local works, using LoadAligned - test.RunLclVarScenario_LoadAligned(); - } - - // Validates passing the field of a local works - test.RunLclFldScenario(); - - // Validates passing an instance member works - test.RunFldScenario(); - } - else - { - // Validates we throw on unsupported hardware - test.RunUnsupportedScenario(); - } - } - catch (PlatformNotSupportedException) - { - test.Succeeded = true; - } - - if (!test.Succeeded) - { - throw new Exception("One or more scenarios did not complete as expected."); - } - } - } - - public sealed unsafe class SimpleUnaryOpTest__InsertSingle1 - { - private static readonly int LargestVectorSize = 16; - - private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); - private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); - - private static Single[] _data = new Single[Op1ElementCount]; - - private static Vector128 _clsVar; - - private Vector128 _fld; - - private SimpleUnaryOpTest__DataTable _dataTable; - - static SimpleUnaryOpTest__InsertSingle1() - { - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - } - - public SimpleUnaryOpTest__InsertSingle1() - { - Succeeded = true; - - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - _dataTable = new SimpleUnaryOpTest__DataTable(_data, new Single[RetElementCount], LargestVectorSize); - } - - public bool IsSupported => Sse41.IsSupported; - - public bool Succeeded { get; set; } - - public void RunBasicScenario_UnsafeRead() - { - var result = Sse41.Insert( - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - 1 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_Load() - { - var result = Sse41.Insert( - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 1 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_LoadAligned() - { - var result = Sse41.Insert( - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 1 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_UnsafeRead() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - (byte)1 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_Load() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)1 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_LoadAligned() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)1 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunClsVarScenario() - { - var result = Sse41.Insert( - _clsVar, - (float)2, - 1 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_clsVar, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_UnsafeRead() - { - var firstOp = Unsafe.Read>(_dataTable.inArrayPtr); - var result = Sse41.Insert(firstOp, (float)2, 1); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_Load() - { - var firstOp = Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 1); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_LoadAligned() - { - var firstOp = Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 1); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclFldScenario() - { - var test = new SimpleUnaryOpTest__InsertSingle1(); - var result = Sse41.Insert(test._fld, (float)2, 1); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(test._fld, _dataTable.outArrayPtr); - } - - public void RunFldScenario() - { - var result = Sse41.Insert(_fld, (float)2, 1); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_fld, _dataTable.outArrayPtr); - } - - public void RunUnsupportedScenario() - { - Succeeded = false; - - try - { - RunBasicScenario_UnsafeRead(); - } - catch (PlatformNotSupportedException) - { - Succeeded = true; - } - } - - private void ValidateResult(Vector128 firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray[0]), firstOp); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray[0]), ref Unsafe.AsRef(firstOp), (uint)Unsafe.SizeOf>()); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") - { - - for (var i = 0; i < RetElementCount; i++) - { - if ((i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))) - { - Succeeded = false; - break; - } - } - - if (!Succeeded) - { - Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}(Vector128<9>): {method} failed:"); - Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})"); - Console.WriteLine($" result: ({string.Join(", ", result)})"); - Console.WriteLine(); - } - } - } -} diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.128.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.128.cs deleted file mode 100644 index 0ca49317765a..000000000000 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.128.cs +++ /dev/null @@ -1,321 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/****************************************************************************** - * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * - * changes, please update the corresponding template and run according to the * - * directions listed in the file. * - ******************************************************************************/ - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; - -namespace JIT.HardwareIntrinsics.X86 -{ - public static partial class Program - { - private static void InsertSingle128() - { - var test = new SimpleUnaryOpTest__InsertSingle128(); - - try - { - if (test.IsSupported) - { - // Validates basic functionality works, using Unsafe.Read - test.RunBasicScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates basic functionality works, using Load - test.RunBasicScenario_Load(); - - // Validates basic functionality works, using LoadAligned - test.RunBasicScenario_LoadAligned(); - } - - // Validates calling via reflection works, using Unsafe.Read - test.RunReflectionScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates calling via reflection works, using Load - test.RunReflectionScenario_Load(); - - // Validates calling via reflection works, using LoadAligned - test.RunReflectionScenario_LoadAligned(); - } - - // Validates passing a static member works - test.RunClsVarScenario(); - - // Validates passing a local works, using Unsafe.Read - test.RunLclVarScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates passing a local works, using Load - test.RunLclVarScenario_Load(); - - // Validates passing a local works, using LoadAligned - test.RunLclVarScenario_LoadAligned(); - } - - // Validates passing the field of a local works - test.RunLclFldScenario(); - - // Validates passing an instance member works - test.RunFldScenario(); - } - else - { - // Validates we throw on unsupported hardware - test.RunUnsupportedScenario(); - } - } - catch (PlatformNotSupportedException) - { - test.Succeeded = true; - } - - if (!test.Succeeded) - { - throw new Exception("One or more scenarios did not complete as expected."); - } - } - } - - public sealed unsafe class SimpleUnaryOpTest__InsertSingle128 - { - private static readonly int LargestVectorSize = 16; - - private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); - private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); - - private static Single[] _data = new Single[Op1ElementCount]; - - private static Vector128 _clsVar; - - private Vector128 _fld; - - private SimpleUnaryOpTest__DataTable _dataTable; - - static SimpleUnaryOpTest__InsertSingle128() - { - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - } - - public SimpleUnaryOpTest__InsertSingle128() - { - Succeeded = true; - - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - _dataTable = new SimpleUnaryOpTest__DataTable(_data, new Single[RetElementCount], LargestVectorSize); - } - - public bool IsSupported => Sse41.IsSupported; - - public bool Succeeded { get; set; } - - public void RunBasicScenario_UnsafeRead() - { - var result = Sse41.Insert( - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - 128 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_Load() - { - var result = Sse41.Insert( - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 128 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_LoadAligned() - { - var result = Sse41.Insert( - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 128 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_UnsafeRead() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - (byte)128 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_Load() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)128 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_LoadAligned() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)128 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunClsVarScenario() - { - var result = Sse41.Insert( - _clsVar, - (float)2, - 128 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_clsVar, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_UnsafeRead() - { - var firstOp = Unsafe.Read>(_dataTable.inArrayPtr); - var result = Sse41.Insert(firstOp, (float)2, 128); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_Load() - { - var firstOp = Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 128); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_LoadAligned() - { - var firstOp = Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 128); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclFldScenario() - { - var test = new SimpleUnaryOpTest__InsertSingle128(); - var result = Sse41.Insert(test._fld, (float)2, 128); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(test._fld, _dataTable.outArrayPtr); - } - - public void RunFldScenario() - { - var result = Sse41.Insert(_fld, (float)2, 128); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_fld, _dataTable.outArrayPtr); - } - - public void RunUnsupportedScenario() - { - Succeeded = false; - - try - { - RunBasicScenario_UnsafeRead(); - } - catch (PlatformNotSupportedException) - { - Succeeded = true; - } - } - - private void ValidateResult(Vector128 firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray[0]), firstOp); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray[0]), ref Unsafe.AsRef(firstOp), (uint)Unsafe.SizeOf>()); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") - { - - for (var i = 0; i < RetElementCount; i++) - { - if ((i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))) - { - Succeeded = false; - break; - } - } - - if (!Succeeded) - { - Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}(Vector128<9>): {method} failed:"); - Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})"); - Console.WriteLine($" result: ({string.Join(", ", result)})"); - Console.WriteLine(); - } - } - } -} diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.129.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.129.cs deleted file mode 100644 index 8b30e9f31936..000000000000 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.129.cs +++ /dev/null @@ -1,321 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/****************************************************************************** - * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * - * changes, please update the corresponding template and run according to the * - * directions listed in the file. * - ******************************************************************************/ - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; - -namespace JIT.HardwareIntrinsics.X86 -{ - public static partial class Program - { - private static void InsertSingle129() - { - var test = new SimpleUnaryOpTest__InsertSingle129(); - - try - { - if (test.IsSupported) - { - // Validates basic functionality works, using Unsafe.Read - test.RunBasicScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates basic functionality works, using Load - test.RunBasicScenario_Load(); - - // Validates basic functionality works, using LoadAligned - test.RunBasicScenario_LoadAligned(); - } - - // Validates calling via reflection works, using Unsafe.Read - test.RunReflectionScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates calling via reflection works, using Load - test.RunReflectionScenario_Load(); - - // Validates calling via reflection works, using LoadAligned - test.RunReflectionScenario_LoadAligned(); - } - - // Validates passing a static member works - test.RunClsVarScenario(); - - // Validates passing a local works, using Unsafe.Read - test.RunLclVarScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates passing a local works, using Load - test.RunLclVarScenario_Load(); - - // Validates passing a local works, using LoadAligned - test.RunLclVarScenario_LoadAligned(); - } - - // Validates passing the field of a local works - test.RunLclFldScenario(); - - // Validates passing an instance member works - test.RunFldScenario(); - } - else - { - // Validates we throw on unsupported hardware - test.RunUnsupportedScenario(); - } - } - catch (PlatformNotSupportedException) - { - test.Succeeded = true; - } - - if (!test.Succeeded) - { - throw new Exception("One or more scenarios did not complete as expected."); - } - } - } - - public sealed unsafe class SimpleUnaryOpTest__InsertSingle129 - { - private static readonly int LargestVectorSize = 16; - - private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); - private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); - - private static Single[] _data = new Single[Op1ElementCount]; - - private static Vector128 _clsVar; - - private Vector128 _fld; - - private SimpleUnaryOpTest__DataTable _dataTable; - - static SimpleUnaryOpTest__InsertSingle129() - { - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - } - - public SimpleUnaryOpTest__InsertSingle129() - { - Succeeded = true; - - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - _dataTable = new SimpleUnaryOpTest__DataTable(_data, new Single[RetElementCount], LargestVectorSize); - } - - public bool IsSupported => Sse41.IsSupported; - - public bool Succeeded { get; set; } - - public void RunBasicScenario_UnsafeRead() - { - var result = Sse41.Insert( - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - 129 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_Load() - { - var result = Sse41.Insert( - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 129 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_LoadAligned() - { - var result = Sse41.Insert( - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 129 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_UnsafeRead() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - (byte)129 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_Load() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)129 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_LoadAligned() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)129 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunClsVarScenario() - { - var result = Sse41.Insert( - _clsVar, - (float)2, - 129 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_clsVar, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_UnsafeRead() - { - var firstOp = Unsafe.Read>(_dataTable.inArrayPtr); - var result = Sse41.Insert(firstOp, (float)2, 129); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_Load() - { - var firstOp = Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 129); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_LoadAligned() - { - var firstOp = Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 129); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclFldScenario() - { - var test = new SimpleUnaryOpTest__InsertSingle129(); - var result = Sse41.Insert(test._fld, (float)2, 129); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(test._fld, _dataTable.outArrayPtr); - } - - public void RunFldScenario() - { - var result = Sse41.Insert(_fld, (float)2, 129); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_fld, _dataTable.outArrayPtr); - } - - public void RunUnsupportedScenario() - { - Succeeded = false; - - try - { - RunBasicScenario_UnsafeRead(); - } - catch (PlatformNotSupportedException) - { - Succeeded = true; - } - } - - private void ValidateResult(Vector128 firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray[0]), firstOp); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray[0]), ref Unsafe.AsRef(firstOp), (uint)Unsafe.SizeOf>()); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") - { - - for (var i = 0; i < RetElementCount; i++) - { - if ((i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))) - { - Succeeded = false; - break; - } - } - - if (!Succeeded) - { - Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}(Vector128<9>): {method} failed:"); - Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})"); - Console.WriteLine($" result: ({string.Join(", ", result)})"); - Console.WriteLine(); - } - } - } -} diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.16.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.16.cs deleted file mode 100644 index a491c1029193..000000000000 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.16.cs +++ /dev/null @@ -1,321 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/****************************************************************************** - * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * - * changes, please update the corresponding template and run according to the * - * directions listed in the file. * - ******************************************************************************/ - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; - -namespace JIT.HardwareIntrinsics.X86 -{ - public static partial class Program - { - private static void InsertSingle16() - { - var test = new SimpleUnaryOpTest__InsertSingle16(); - - try - { - if (test.IsSupported) - { - // Validates basic functionality works, using Unsafe.Read - test.RunBasicScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates basic functionality works, using Load - test.RunBasicScenario_Load(); - - // Validates basic functionality works, using LoadAligned - test.RunBasicScenario_LoadAligned(); - } - - // Validates calling via reflection works, using Unsafe.Read - test.RunReflectionScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates calling via reflection works, using Load - test.RunReflectionScenario_Load(); - - // Validates calling via reflection works, using LoadAligned - test.RunReflectionScenario_LoadAligned(); - } - - // Validates passing a static member works - test.RunClsVarScenario(); - - // Validates passing a local works, using Unsafe.Read - test.RunLclVarScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates passing a local works, using Load - test.RunLclVarScenario_Load(); - - // Validates passing a local works, using LoadAligned - test.RunLclVarScenario_LoadAligned(); - } - - // Validates passing the field of a local works - test.RunLclFldScenario(); - - // Validates passing an instance member works - test.RunFldScenario(); - } - else - { - // Validates we throw on unsupported hardware - test.RunUnsupportedScenario(); - } - } - catch (PlatformNotSupportedException) - { - test.Succeeded = true; - } - - if (!test.Succeeded) - { - throw new Exception("One or more scenarios did not complete as expected."); - } - } - } - - public sealed unsafe class SimpleUnaryOpTest__InsertSingle16 - { - private static readonly int LargestVectorSize = 16; - - private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); - private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); - - private static Single[] _data = new Single[Op1ElementCount]; - - private static Vector128 _clsVar; - - private Vector128 _fld; - - private SimpleUnaryOpTest__DataTable _dataTable; - - static SimpleUnaryOpTest__InsertSingle16() - { - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - } - - public SimpleUnaryOpTest__InsertSingle16() - { - Succeeded = true; - - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - _dataTable = new SimpleUnaryOpTest__DataTable(_data, new Single[RetElementCount], LargestVectorSize); - } - - public bool IsSupported => Sse41.IsSupported; - - public bool Succeeded { get; set; } - - public void RunBasicScenario_UnsafeRead() - { - var result = Sse41.Insert( - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - 16 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_Load() - { - var result = Sse41.Insert( - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 16 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_LoadAligned() - { - var result = Sse41.Insert( - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 16 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_UnsafeRead() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - (byte)16 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_Load() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)16 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_LoadAligned() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)16 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunClsVarScenario() - { - var result = Sse41.Insert( - _clsVar, - (float)2, - 16 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_clsVar, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_UnsafeRead() - { - var firstOp = Unsafe.Read>(_dataTable.inArrayPtr); - var result = Sse41.Insert(firstOp, (float)2, 16); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_Load() - { - var firstOp = Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 16); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_LoadAligned() - { - var firstOp = Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 16); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclFldScenario() - { - var test = new SimpleUnaryOpTest__InsertSingle16(); - var result = Sse41.Insert(test._fld, (float)2, 16); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(test._fld, _dataTable.outArrayPtr); - } - - public void RunFldScenario() - { - var result = Sse41.Insert(_fld, (float)2, 16); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_fld, _dataTable.outArrayPtr); - } - - public void RunUnsupportedScenario() - { - Succeeded = false; - - try - { - RunBasicScenario_UnsafeRead(); - } - catch (PlatformNotSupportedException) - { - Succeeded = true; - } - } - - private void ValidateResult(Vector128 firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray[0]), firstOp); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray[0]), ref Unsafe.AsRef(firstOp), (uint)Unsafe.SizeOf>()); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") - { - - for (var i = 0; i < RetElementCount; i++) - { - if ((i == 1 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))) - { - Succeeded = false; - break; - } - } - - if (!Succeeded) - { - Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}(Vector128<9>): {method} failed:"); - Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})"); - Console.WriteLine($" result: ({string.Join(", ", result)})"); - Console.WriteLine(); - } - } - } -} diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.192.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.192.cs deleted file mode 100644 index f8908e3588f8..000000000000 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.192.cs +++ /dev/null @@ -1,321 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/****************************************************************************** - * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * - * changes, please update the corresponding template and run according to the * - * directions listed in the file. * - ******************************************************************************/ - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; - -namespace JIT.HardwareIntrinsics.X86 -{ - public static partial class Program - { - private static void InsertSingle192() - { - var test = new SimpleUnaryOpTest__InsertSingle192(); - - try - { - if (test.IsSupported) - { - // Validates basic functionality works, using Unsafe.Read - test.RunBasicScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates basic functionality works, using Load - test.RunBasicScenario_Load(); - - // Validates basic functionality works, using LoadAligned - test.RunBasicScenario_LoadAligned(); - } - - // Validates calling via reflection works, using Unsafe.Read - test.RunReflectionScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates calling via reflection works, using Load - test.RunReflectionScenario_Load(); - - // Validates calling via reflection works, using LoadAligned - test.RunReflectionScenario_LoadAligned(); - } - - // Validates passing a static member works - test.RunClsVarScenario(); - - // Validates passing a local works, using Unsafe.Read - test.RunLclVarScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates passing a local works, using Load - test.RunLclVarScenario_Load(); - - // Validates passing a local works, using LoadAligned - test.RunLclVarScenario_LoadAligned(); - } - - // Validates passing the field of a local works - test.RunLclFldScenario(); - - // Validates passing an instance member works - test.RunFldScenario(); - } - else - { - // Validates we throw on unsupported hardware - test.RunUnsupportedScenario(); - } - } - catch (PlatformNotSupportedException) - { - test.Succeeded = true; - } - - if (!test.Succeeded) - { - throw new Exception("One or more scenarios did not complete as expected."); - } - } - } - - public sealed unsafe class SimpleUnaryOpTest__InsertSingle192 - { - private static readonly int LargestVectorSize = 16; - - private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); - private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); - - private static Single[] _data = new Single[Op1ElementCount]; - - private static Vector128 _clsVar; - - private Vector128 _fld; - - private SimpleUnaryOpTest__DataTable _dataTable; - - static SimpleUnaryOpTest__InsertSingle192() - { - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - } - - public SimpleUnaryOpTest__InsertSingle192() - { - Succeeded = true; - - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - _dataTable = new SimpleUnaryOpTest__DataTable(_data, new Single[RetElementCount], LargestVectorSize); - } - - public bool IsSupported => Sse41.IsSupported; - - public bool Succeeded { get; set; } - - public void RunBasicScenario_UnsafeRead() - { - var result = Sse41.Insert( - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - 192 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_Load() - { - var result = Sse41.Insert( - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 192 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_LoadAligned() - { - var result = Sse41.Insert( - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 192 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_UnsafeRead() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - (byte)192 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_Load() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)192 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_LoadAligned() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)192 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunClsVarScenario() - { - var result = Sse41.Insert( - _clsVar, - (float)2, - 192 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_clsVar, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_UnsafeRead() - { - var firstOp = Unsafe.Read>(_dataTable.inArrayPtr); - var result = Sse41.Insert(firstOp, (float)2, 192); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_Load() - { - var firstOp = Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 192); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_LoadAligned() - { - var firstOp = Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 192); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclFldScenario() - { - var test = new SimpleUnaryOpTest__InsertSingle192(); - var result = Sse41.Insert(test._fld, (float)2, 192); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(test._fld, _dataTable.outArrayPtr); - } - - public void RunFldScenario() - { - var result = Sse41.Insert(_fld, (float)2, 192); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_fld, _dataTable.outArrayPtr); - } - - public void RunUnsupportedScenario() - { - Succeeded = false; - - try - { - RunBasicScenario_UnsafeRead(); - } - catch (PlatformNotSupportedException) - { - Succeeded = true; - } - } - - private void ValidateResult(Vector128 firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray[0]), firstOp); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray[0]), ref Unsafe.AsRef(firstOp), (uint)Unsafe.SizeOf>()); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") - { - - for (var i = 0; i < RetElementCount; i++) - { - if ((i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))) - { - Succeeded = false; - break; - } - } - - if (!Succeeded) - { - Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}(Vector128<9>): {method} failed:"); - Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})"); - Console.WriteLine($" result: ({string.Join(", ", result)})"); - Console.WriteLine(); - } - } - } -} diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.2.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.2.cs deleted file mode 100644 index 44ead60aec3d..000000000000 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.2.cs +++ /dev/null @@ -1,321 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/****************************************************************************** - * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * - * changes, please update the corresponding template and run according to the * - * directions listed in the file. * - ******************************************************************************/ - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; - -namespace JIT.HardwareIntrinsics.X86 -{ - public static partial class Program - { - private static void InsertSingle2() - { - var test = new SimpleUnaryOpTest__InsertSingle2(); - - try - { - if (test.IsSupported) - { - // Validates basic functionality works, using Unsafe.Read - test.RunBasicScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates basic functionality works, using Load - test.RunBasicScenario_Load(); - - // Validates basic functionality works, using LoadAligned - test.RunBasicScenario_LoadAligned(); - } - - // Validates calling via reflection works, using Unsafe.Read - test.RunReflectionScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates calling via reflection works, using Load - test.RunReflectionScenario_Load(); - - // Validates calling via reflection works, using LoadAligned - test.RunReflectionScenario_LoadAligned(); - } - - // Validates passing a static member works - test.RunClsVarScenario(); - - // Validates passing a local works, using Unsafe.Read - test.RunLclVarScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates passing a local works, using Load - test.RunLclVarScenario_Load(); - - // Validates passing a local works, using LoadAligned - test.RunLclVarScenario_LoadAligned(); - } - - // Validates passing the field of a local works - test.RunLclFldScenario(); - - // Validates passing an instance member works - test.RunFldScenario(); - } - else - { - // Validates we throw on unsupported hardware - test.RunUnsupportedScenario(); - } - } - catch (PlatformNotSupportedException) - { - test.Succeeded = true; - } - - if (!test.Succeeded) - { - throw new Exception("One or more scenarios did not complete as expected."); - } - } - } - - public sealed unsafe class SimpleUnaryOpTest__InsertSingle2 - { - private static readonly int LargestVectorSize = 16; - - private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); - private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); - - private static Single[] _data = new Single[Op1ElementCount]; - - private static Vector128 _clsVar; - - private Vector128 _fld; - - private SimpleUnaryOpTest__DataTable _dataTable; - - static SimpleUnaryOpTest__InsertSingle2() - { - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - } - - public SimpleUnaryOpTest__InsertSingle2() - { - Succeeded = true; - - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - _dataTable = new SimpleUnaryOpTest__DataTable(_data, new Single[RetElementCount], LargestVectorSize); - } - - public bool IsSupported => Sse41.IsSupported; - - public bool Succeeded { get; set; } - - public void RunBasicScenario_UnsafeRead() - { - var result = Sse41.Insert( - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - 2 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_Load() - { - var result = Sse41.Insert( - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 2 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_LoadAligned() - { - var result = Sse41.Insert( - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 2 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_UnsafeRead() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - (byte)2 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_Load() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)2 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_LoadAligned() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)2 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunClsVarScenario() - { - var result = Sse41.Insert( - _clsVar, - (float)2, - 2 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_clsVar, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_UnsafeRead() - { - var firstOp = Unsafe.Read>(_dataTable.inArrayPtr); - var result = Sse41.Insert(firstOp, (float)2, 2); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_Load() - { - var firstOp = Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 2); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_LoadAligned() - { - var firstOp = Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 2); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclFldScenario() - { - var test = new SimpleUnaryOpTest__InsertSingle2(); - var result = Sse41.Insert(test._fld, (float)2, 2); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(test._fld, _dataTable.outArrayPtr); - } - - public void RunFldScenario() - { - var result = Sse41.Insert(_fld, (float)2, 2); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_fld, _dataTable.outArrayPtr); - } - - public void RunUnsupportedScenario() - { - Succeeded = false; - - try - { - RunBasicScenario_UnsafeRead(); - } - catch (PlatformNotSupportedException) - { - Succeeded = true; - } - } - - private void ValidateResult(Vector128 firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray[0]), firstOp); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray[0]), ref Unsafe.AsRef(firstOp), (uint)Unsafe.SizeOf>()); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") - { - - for (var i = 0; i < RetElementCount; i++) - { - if ((i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : i == 1 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))) - { - Succeeded = false; - break; - } - } - - if (!Succeeded) - { - Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}(Vector128<9>): {method} failed:"); - Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})"); - Console.WriteLine($" result: ({string.Join(", ", result)})"); - Console.WriteLine(); - } - } - } -} diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.217.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.217.cs deleted file mode 100644 index 64872177fdff..000000000000 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.217.cs +++ /dev/null @@ -1,321 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/****************************************************************************** - * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * - * changes, please update the corresponding template and run according to the * - * directions listed in the file. * - ******************************************************************************/ - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; - -namespace JIT.HardwareIntrinsics.X86 -{ - public static partial class Program - { - private static void InsertSingle217() - { - var test = new SimpleUnaryOpTest__InsertSingle217(); - - try - { - if (test.IsSupported) - { - // Validates basic functionality works, using Unsafe.Read - test.RunBasicScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates basic functionality works, using Load - test.RunBasicScenario_Load(); - - // Validates basic functionality works, using LoadAligned - test.RunBasicScenario_LoadAligned(); - } - - // Validates calling via reflection works, using Unsafe.Read - test.RunReflectionScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates calling via reflection works, using Load - test.RunReflectionScenario_Load(); - - // Validates calling via reflection works, using LoadAligned - test.RunReflectionScenario_LoadAligned(); - } - - // Validates passing a static member works - test.RunClsVarScenario(); - - // Validates passing a local works, using Unsafe.Read - test.RunLclVarScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates passing a local works, using Load - test.RunLclVarScenario_Load(); - - // Validates passing a local works, using LoadAligned - test.RunLclVarScenario_LoadAligned(); - } - - // Validates passing the field of a local works - test.RunLclFldScenario(); - - // Validates passing an instance member works - test.RunFldScenario(); - } - else - { - // Validates we throw on unsupported hardware - test.RunUnsupportedScenario(); - } - } - catch (PlatformNotSupportedException) - { - test.Succeeded = true; - } - - if (!test.Succeeded) - { - throw new Exception("One or more scenarios did not complete as expected."); - } - } - } - - public sealed unsafe class SimpleUnaryOpTest__InsertSingle217 - { - private static readonly int LargestVectorSize = 16; - - private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); - private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); - - private static Single[] _data = new Single[Op1ElementCount]; - - private static Vector128 _clsVar; - - private Vector128 _fld; - - private SimpleUnaryOpTest__DataTable _dataTable; - - static SimpleUnaryOpTest__InsertSingle217() - { - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - } - - public SimpleUnaryOpTest__InsertSingle217() - { - Succeeded = true; - - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - _dataTable = new SimpleUnaryOpTest__DataTable(_data, new Single[RetElementCount], LargestVectorSize); - } - - public bool IsSupported => Sse41.IsSupported; - - public bool Succeeded { get; set; } - - public void RunBasicScenario_UnsafeRead() - { - var result = Sse41.Insert( - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - 217 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_Load() - { - var result = Sse41.Insert( - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 217 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_LoadAligned() - { - var result = Sse41.Insert( - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 217 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_UnsafeRead() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - (byte)217 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_Load() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)217 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_LoadAligned() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)217 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunClsVarScenario() - { - var result = Sse41.Insert( - _clsVar, - (float)2, - 217 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_clsVar, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_UnsafeRead() - { - var firstOp = Unsafe.Read>(_dataTable.inArrayPtr); - var result = Sse41.Insert(firstOp, (float)2, 217); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_Load() - { - var firstOp = Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 217); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_LoadAligned() - { - var firstOp = Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 217); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclFldScenario() - { - var test = new SimpleUnaryOpTest__InsertSingle217(); - var result = Sse41.Insert(test._fld, (float)2, 217); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(test._fld, _dataTable.outArrayPtr); - } - - public void RunFldScenario() - { - var result = Sse41.Insert(_fld, (float)2, 217); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_fld, _dataTable.outArrayPtr); - } - - public void RunUnsupportedScenario() - { - Succeeded = false; - - try - { - RunBasicScenario_UnsafeRead(); - } - catch (PlatformNotSupportedException) - { - Succeeded = true; - } - } - - private void ValidateResult(Vector128 firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray[0]), firstOp); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray[0]), ref Unsafe.AsRef(firstOp), (uint)Unsafe.SizeOf>()); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") - { - - for (var i = 0; i < RetElementCount; i++) - { - if ((i == 2 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits((float)0))) - { - Succeeded = false; - break; - } - } - - if (!Succeeded) - { - Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}(Vector128<9>): {method} failed:"); - Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})"); - Console.WriteLine($" result: ({string.Join(", ", result)})"); - Console.WriteLine(); - } - } - } -} diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.32.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.32.cs deleted file mode 100644 index 6d647afde19c..000000000000 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.32.cs +++ /dev/null @@ -1,321 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/****************************************************************************** - * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * - * changes, please update the corresponding template and run according to the * - * directions listed in the file. * - ******************************************************************************/ - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; - -namespace JIT.HardwareIntrinsics.X86 -{ - public static partial class Program - { - private static void InsertSingle32() - { - var test = new SimpleUnaryOpTest__InsertSingle32(); - - try - { - if (test.IsSupported) - { - // Validates basic functionality works, using Unsafe.Read - test.RunBasicScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates basic functionality works, using Load - test.RunBasicScenario_Load(); - - // Validates basic functionality works, using LoadAligned - test.RunBasicScenario_LoadAligned(); - } - - // Validates calling via reflection works, using Unsafe.Read - test.RunReflectionScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates calling via reflection works, using Load - test.RunReflectionScenario_Load(); - - // Validates calling via reflection works, using LoadAligned - test.RunReflectionScenario_LoadAligned(); - } - - // Validates passing a static member works - test.RunClsVarScenario(); - - // Validates passing a local works, using Unsafe.Read - test.RunLclVarScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates passing a local works, using Load - test.RunLclVarScenario_Load(); - - // Validates passing a local works, using LoadAligned - test.RunLclVarScenario_LoadAligned(); - } - - // Validates passing the field of a local works - test.RunLclFldScenario(); - - // Validates passing an instance member works - test.RunFldScenario(); - } - else - { - // Validates we throw on unsupported hardware - test.RunUnsupportedScenario(); - } - } - catch (PlatformNotSupportedException) - { - test.Succeeded = true; - } - - if (!test.Succeeded) - { - throw new Exception("One or more scenarios did not complete as expected."); - } - } - } - - public sealed unsafe class SimpleUnaryOpTest__InsertSingle32 - { - private static readonly int LargestVectorSize = 16; - - private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); - private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); - - private static Single[] _data = new Single[Op1ElementCount]; - - private static Vector128 _clsVar; - - private Vector128 _fld; - - private SimpleUnaryOpTest__DataTable _dataTable; - - static SimpleUnaryOpTest__InsertSingle32() - { - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - } - - public SimpleUnaryOpTest__InsertSingle32() - { - Succeeded = true; - - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - _dataTable = new SimpleUnaryOpTest__DataTable(_data, new Single[RetElementCount], LargestVectorSize); - } - - public bool IsSupported => Sse41.IsSupported; - - public bool Succeeded { get; set; } - - public void RunBasicScenario_UnsafeRead() - { - var result = Sse41.Insert( - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - 32 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_Load() - { - var result = Sse41.Insert( - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 32 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_LoadAligned() - { - var result = Sse41.Insert( - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 32 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_UnsafeRead() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - (byte)32 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_Load() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)32 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_LoadAligned() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)32 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunClsVarScenario() - { - var result = Sse41.Insert( - _clsVar, - (float)2, - 32 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_clsVar, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_UnsafeRead() - { - var firstOp = Unsafe.Read>(_dataTable.inArrayPtr); - var result = Sse41.Insert(firstOp, (float)2, 32); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_Load() - { - var firstOp = Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 32); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_LoadAligned() - { - var firstOp = Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 32); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclFldScenario() - { - var test = new SimpleUnaryOpTest__InsertSingle32(); - var result = Sse41.Insert(test._fld, (float)2, 32); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(test._fld, _dataTable.outArrayPtr); - } - - public void RunFldScenario() - { - var result = Sse41.Insert(_fld, (float)2, 32); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_fld, _dataTable.outArrayPtr); - } - - public void RunUnsupportedScenario() - { - Succeeded = false; - - try - { - RunBasicScenario_UnsafeRead(); - } - catch (PlatformNotSupportedException) - { - Succeeded = true; - } - } - - private void ValidateResult(Vector128 firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray[0]), firstOp); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray[0]), ref Unsafe.AsRef(firstOp), (uint)Unsafe.SizeOf>()); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") - { - - for (var i = 0; i < RetElementCount; i++) - { - if ((i == 2 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))) - { - Succeeded = false; - break; - } - } - - if (!Succeeded) - { - Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}(Vector128<9>): {method} failed:"); - Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})"); - Console.WriteLine($" result: ({string.Join(", ", result)})"); - Console.WriteLine(); - } - } - } -} diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.4.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.4.cs deleted file mode 100644 index c47c9d28e934..000000000000 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.4.cs +++ /dev/null @@ -1,321 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/****************************************************************************** - * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * - * changes, please update the corresponding template and run according to the * - * directions listed in the file. * - ******************************************************************************/ - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; - -namespace JIT.HardwareIntrinsics.X86 -{ - public static partial class Program - { - private static void InsertSingle4() - { - var test = new SimpleUnaryOpTest__InsertSingle4(); - - try - { - if (test.IsSupported) - { - // Validates basic functionality works, using Unsafe.Read - test.RunBasicScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates basic functionality works, using Load - test.RunBasicScenario_Load(); - - // Validates basic functionality works, using LoadAligned - test.RunBasicScenario_LoadAligned(); - } - - // Validates calling via reflection works, using Unsafe.Read - test.RunReflectionScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates calling via reflection works, using Load - test.RunReflectionScenario_Load(); - - // Validates calling via reflection works, using LoadAligned - test.RunReflectionScenario_LoadAligned(); - } - - // Validates passing a static member works - test.RunClsVarScenario(); - - // Validates passing a local works, using Unsafe.Read - test.RunLclVarScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates passing a local works, using Load - test.RunLclVarScenario_Load(); - - // Validates passing a local works, using LoadAligned - test.RunLclVarScenario_LoadAligned(); - } - - // Validates passing the field of a local works - test.RunLclFldScenario(); - - // Validates passing an instance member works - test.RunFldScenario(); - } - else - { - // Validates we throw on unsupported hardware - test.RunUnsupportedScenario(); - } - } - catch (PlatformNotSupportedException) - { - test.Succeeded = true; - } - - if (!test.Succeeded) - { - throw new Exception("One or more scenarios did not complete as expected."); - } - } - } - - public sealed unsafe class SimpleUnaryOpTest__InsertSingle4 - { - private static readonly int LargestVectorSize = 16; - - private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); - private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); - - private static Single[] _data = new Single[Op1ElementCount]; - - private static Vector128 _clsVar; - - private Vector128 _fld; - - private SimpleUnaryOpTest__DataTable _dataTable; - - static SimpleUnaryOpTest__InsertSingle4() - { - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - } - - public SimpleUnaryOpTest__InsertSingle4() - { - Succeeded = true; - - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - _dataTable = new SimpleUnaryOpTest__DataTable(_data, new Single[RetElementCount], LargestVectorSize); - } - - public bool IsSupported => Sse41.IsSupported; - - public bool Succeeded { get; set; } - - public void RunBasicScenario_UnsafeRead() - { - var result = Sse41.Insert( - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - 4 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_Load() - { - var result = Sse41.Insert( - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 4 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_LoadAligned() - { - var result = Sse41.Insert( - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 4 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_UnsafeRead() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - (byte)4 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_Load() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)4 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_LoadAligned() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)4 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunClsVarScenario() - { - var result = Sse41.Insert( - _clsVar, - (float)2, - 4 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_clsVar, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_UnsafeRead() - { - var firstOp = Unsafe.Read>(_dataTable.inArrayPtr); - var result = Sse41.Insert(firstOp, (float)2, 4); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_Load() - { - var firstOp = Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 4); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_LoadAligned() - { - var firstOp = Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 4); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclFldScenario() - { - var test = new SimpleUnaryOpTest__InsertSingle4(); - var result = Sse41.Insert(test._fld, (float)2, 4); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(test._fld, _dataTable.outArrayPtr); - } - - public void RunFldScenario() - { - var result = Sse41.Insert(_fld, (float)2, 4); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_fld, _dataTable.outArrayPtr); - } - - public void RunUnsupportedScenario() - { - Succeeded = false; - - try - { - RunBasicScenario_UnsafeRead(); - } - catch (PlatformNotSupportedException) - { - Succeeded = true; - } - } - - private void ValidateResult(Vector128 firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray[0]), firstOp); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray[0]), ref Unsafe.AsRef(firstOp), (uint)Unsafe.SizeOf>()); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") - { - - for (var i = 0; i < RetElementCount; i++) - { - if ((i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : i == 2 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))) - { - Succeeded = false; - break; - } - } - - if (!Succeeded) - { - Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}(Vector128<9>): {method} failed:"); - Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})"); - Console.WriteLine($" result: ({string.Join(", ", result)})"); - Console.WriteLine(); - } - } - } -} diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.48.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.48.cs deleted file mode 100644 index 4a8eef9c61e6..000000000000 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.48.cs +++ /dev/null @@ -1,321 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/****************************************************************************** - * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * - * changes, please update the corresponding template and run according to the * - * directions listed in the file. * - ******************************************************************************/ - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; - -namespace JIT.HardwareIntrinsics.X86 -{ - public static partial class Program - { - private static void InsertSingle48() - { - var test = new SimpleUnaryOpTest__InsertSingle48(); - - try - { - if (test.IsSupported) - { - // Validates basic functionality works, using Unsafe.Read - test.RunBasicScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates basic functionality works, using Load - test.RunBasicScenario_Load(); - - // Validates basic functionality works, using LoadAligned - test.RunBasicScenario_LoadAligned(); - } - - // Validates calling via reflection works, using Unsafe.Read - test.RunReflectionScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates calling via reflection works, using Load - test.RunReflectionScenario_Load(); - - // Validates calling via reflection works, using LoadAligned - test.RunReflectionScenario_LoadAligned(); - } - - // Validates passing a static member works - test.RunClsVarScenario(); - - // Validates passing a local works, using Unsafe.Read - test.RunLclVarScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates passing a local works, using Load - test.RunLclVarScenario_Load(); - - // Validates passing a local works, using LoadAligned - test.RunLclVarScenario_LoadAligned(); - } - - // Validates passing the field of a local works - test.RunLclFldScenario(); - - // Validates passing an instance member works - test.RunFldScenario(); - } - else - { - // Validates we throw on unsupported hardware - test.RunUnsupportedScenario(); - } - } - catch (PlatformNotSupportedException) - { - test.Succeeded = true; - } - - if (!test.Succeeded) - { - throw new Exception("One or more scenarios did not complete as expected."); - } - } - } - - public sealed unsafe class SimpleUnaryOpTest__InsertSingle48 - { - private static readonly int LargestVectorSize = 16; - - private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); - private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); - - private static Single[] _data = new Single[Op1ElementCount]; - - private static Vector128 _clsVar; - - private Vector128 _fld; - - private SimpleUnaryOpTest__DataTable _dataTable; - - static SimpleUnaryOpTest__InsertSingle48() - { - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - } - - public SimpleUnaryOpTest__InsertSingle48() - { - Succeeded = true; - - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - _dataTable = new SimpleUnaryOpTest__DataTable(_data, new Single[RetElementCount], LargestVectorSize); - } - - public bool IsSupported => Sse41.IsSupported; - - public bool Succeeded { get; set; } - - public void RunBasicScenario_UnsafeRead() - { - var result = Sse41.Insert( - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - 48 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_Load() - { - var result = Sse41.Insert( - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 48 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_LoadAligned() - { - var result = Sse41.Insert( - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 48 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_UnsafeRead() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - (byte)48 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_Load() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)48 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_LoadAligned() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)48 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunClsVarScenario() - { - var result = Sse41.Insert( - _clsVar, - (float)2, - 48 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_clsVar, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_UnsafeRead() - { - var firstOp = Unsafe.Read>(_dataTable.inArrayPtr); - var result = Sse41.Insert(firstOp, (float)2, 48); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_Load() - { - var firstOp = Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 48); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_LoadAligned() - { - var firstOp = Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 48); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclFldScenario() - { - var test = new SimpleUnaryOpTest__InsertSingle48(); - var result = Sse41.Insert(test._fld, (float)2, 48); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(test._fld, _dataTable.outArrayPtr); - } - - public void RunFldScenario() - { - var result = Sse41.Insert(_fld, (float)2, 48); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_fld, _dataTable.outArrayPtr); - } - - public void RunUnsupportedScenario() - { - Succeeded = false; - - try - { - RunBasicScenario_UnsafeRead(); - } - catch (PlatformNotSupportedException) - { - Succeeded = true; - } - } - - private void ValidateResult(Vector128 firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray[0]), firstOp); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray[0]), ref Unsafe.AsRef(firstOp), (uint)Unsafe.SizeOf>()); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") - { - - for (var i = 0; i < RetElementCount; i++) - { - if ((i == 3 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))) - { - Succeeded = false; - break; - } - } - - if (!Succeeded) - { - Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}(Vector128<9>): {method} failed:"); - Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})"); - Console.WriteLine($" result: ({string.Join(", ", result)})"); - Console.WriteLine(); - } - } - } -} diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.64.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.64.cs deleted file mode 100644 index feddaad2e68f..000000000000 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.64.cs +++ /dev/null @@ -1,321 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/****************************************************************************** - * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * - * changes, please update the corresponding template and run according to the * - * directions listed in the file. * - ******************************************************************************/ - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; - -namespace JIT.HardwareIntrinsics.X86 -{ - public static partial class Program - { - private static void InsertSingle64() - { - var test = new SimpleUnaryOpTest__InsertSingle64(); - - try - { - if (test.IsSupported) - { - // Validates basic functionality works, using Unsafe.Read - test.RunBasicScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates basic functionality works, using Load - test.RunBasicScenario_Load(); - - // Validates basic functionality works, using LoadAligned - test.RunBasicScenario_LoadAligned(); - } - - // Validates calling via reflection works, using Unsafe.Read - test.RunReflectionScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates calling via reflection works, using Load - test.RunReflectionScenario_Load(); - - // Validates calling via reflection works, using LoadAligned - test.RunReflectionScenario_LoadAligned(); - } - - // Validates passing a static member works - test.RunClsVarScenario(); - - // Validates passing a local works, using Unsafe.Read - test.RunLclVarScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates passing a local works, using Load - test.RunLclVarScenario_Load(); - - // Validates passing a local works, using LoadAligned - test.RunLclVarScenario_LoadAligned(); - } - - // Validates passing the field of a local works - test.RunLclFldScenario(); - - // Validates passing an instance member works - test.RunFldScenario(); - } - else - { - // Validates we throw on unsupported hardware - test.RunUnsupportedScenario(); - } - } - catch (PlatformNotSupportedException) - { - test.Succeeded = true; - } - - if (!test.Succeeded) - { - throw new Exception("One or more scenarios did not complete as expected."); - } - } - } - - public sealed unsafe class SimpleUnaryOpTest__InsertSingle64 - { - private static readonly int LargestVectorSize = 16; - - private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); - private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); - - private static Single[] _data = new Single[Op1ElementCount]; - - private static Vector128 _clsVar; - - private Vector128 _fld; - - private SimpleUnaryOpTest__DataTable _dataTable; - - static SimpleUnaryOpTest__InsertSingle64() - { - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - } - - public SimpleUnaryOpTest__InsertSingle64() - { - Succeeded = true; - - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - _dataTable = new SimpleUnaryOpTest__DataTable(_data, new Single[RetElementCount], LargestVectorSize); - } - - public bool IsSupported => Sse41.IsSupported; - - public bool Succeeded { get; set; } - - public void RunBasicScenario_UnsafeRead() - { - var result = Sse41.Insert( - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - 64 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_Load() - { - var result = Sse41.Insert( - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 64 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_LoadAligned() - { - var result = Sse41.Insert( - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 64 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_UnsafeRead() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - (byte)64 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_Load() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)64 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_LoadAligned() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)64 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunClsVarScenario() - { - var result = Sse41.Insert( - _clsVar, - (float)2, - 64 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_clsVar, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_UnsafeRead() - { - var firstOp = Unsafe.Read>(_dataTable.inArrayPtr); - var result = Sse41.Insert(firstOp, (float)2, 64); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_Load() - { - var firstOp = Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 64); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_LoadAligned() - { - var firstOp = Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 64); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclFldScenario() - { - var test = new SimpleUnaryOpTest__InsertSingle64(); - var result = Sse41.Insert(test._fld, (float)2, 64); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(test._fld, _dataTable.outArrayPtr); - } - - public void RunFldScenario() - { - var result = Sse41.Insert(_fld, (float)2, 64); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_fld, _dataTable.outArrayPtr); - } - - public void RunUnsupportedScenario() - { - Succeeded = false; - - try - { - RunBasicScenario_UnsafeRead(); - } - catch (PlatformNotSupportedException) - { - Succeeded = true; - } - } - - private void ValidateResult(Vector128 firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray[0]), firstOp); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray[0]), ref Unsafe.AsRef(firstOp), (uint)Unsafe.SizeOf>()); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") - { - - for (var i = 0; i < RetElementCount; i++) - { - if ((i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))) - { - Succeeded = false; - break; - } - } - - if (!Succeeded) - { - Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}(Vector128<9>): {method} failed:"); - Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})"); - Console.WriteLine($" result: ({string.Join(", ", result)})"); - Console.WriteLine(); - } - } - } -} diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.8.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.8.cs deleted file mode 100644 index b81444ccb044..000000000000 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Insert.Single.8.cs +++ /dev/null @@ -1,321 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -/****************************************************************************** - * This file is auto-generated from a template file by the GenerateTests.csx * - * script in tests\src\JIT\HardwareIntrinsics\X86\Shared. In order to make * - * changes, please update the corresponding template and run according to the * - * directions listed in the file. * - ******************************************************************************/ - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Runtime.Intrinsics; -using System.Runtime.Intrinsics.X86; - -namespace JIT.HardwareIntrinsics.X86 -{ - public static partial class Program - { - private static void InsertSingle8() - { - var test = new SimpleUnaryOpTest__InsertSingle8(); - - try - { - if (test.IsSupported) - { - // Validates basic functionality works, using Unsafe.Read - test.RunBasicScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates basic functionality works, using Load - test.RunBasicScenario_Load(); - - // Validates basic functionality works, using LoadAligned - test.RunBasicScenario_LoadAligned(); - } - - // Validates calling via reflection works, using Unsafe.Read - test.RunReflectionScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates calling via reflection works, using Load - test.RunReflectionScenario_Load(); - - // Validates calling via reflection works, using LoadAligned - test.RunReflectionScenario_LoadAligned(); - } - - // Validates passing a static member works - test.RunClsVarScenario(); - - // Validates passing a local works, using Unsafe.Read - test.RunLclVarScenario_UnsafeRead(); - - if (Sse.IsSupported) - { - // Validates passing a local works, using Load - test.RunLclVarScenario_Load(); - - // Validates passing a local works, using LoadAligned - test.RunLclVarScenario_LoadAligned(); - } - - // Validates passing the field of a local works - test.RunLclFldScenario(); - - // Validates passing an instance member works - test.RunFldScenario(); - } - else - { - // Validates we throw on unsupported hardware - test.RunUnsupportedScenario(); - } - } - catch (PlatformNotSupportedException) - { - test.Succeeded = true; - } - - if (!test.Succeeded) - { - throw new Exception("One or more scenarios did not complete as expected."); - } - } - } - - public sealed unsafe class SimpleUnaryOpTest__InsertSingle8 - { - private static readonly int LargestVectorSize = 16; - - private static readonly int Op1ElementCount = Unsafe.SizeOf>() / sizeof(Single); - private static readonly int RetElementCount = Unsafe.SizeOf>() / sizeof(Single); - - private static Single[] _data = new Single[Op1ElementCount]; - - private static Vector128 _clsVar; - - private Vector128 _fld; - - private SimpleUnaryOpTest__DataTable _dataTable; - - static SimpleUnaryOpTest__InsertSingle8() - { - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _clsVar), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - } - - public SimpleUnaryOpTest__InsertSingle8() - { - Succeeded = true; - - var random = new Random(); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As, byte>(ref _fld), ref Unsafe.As(ref _data[0]), (uint)Unsafe.SizeOf>()); - - for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (float)(random.NextDouble()); } - _dataTable = new SimpleUnaryOpTest__DataTable(_data, new Single[RetElementCount], LargestVectorSize); - } - - public bool IsSupported => Sse41.IsSupported; - - public bool Succeeded { get; set; } - - public void RunBasicScenario_UnsafeRead() - { - var result = Sse41.Insert( - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - 8 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_Load() - { - var result = Sse41.Insert( - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 8 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunBasicScenario_LoadAligned() - { - var result = Sse41.Insert( - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - 8 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_UnsafeRead() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Unsafe.Read>(_dataTable.inArrayPtr), - (float)2, - (byte)8 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_Load() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)8 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunReflectionScenario_LoadAligned() - { - var result = typeof(Sse41).GetMethod(nameof(Sse41.Insert), new Type[] { typeof(Vector128), typeof(Single), typeof(byte) }) - .Invoke(null, new object[] { - Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)), - (float)2, - (byte)8 - }); - - Unsafe.Write(_dataTable.outArrayPtr, (Vector128)(result)); - ValidateResult(_dataTable.inArrayPtr, _dataTable.outArrayPtr); - } - - public void RunClsVarScenario() - { - var result = Sse41.Insert( - _clsVar, - (float)2, - 8 - ); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_clsVar, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_UnsafeRead() - { - var firstOp = Unsafe.Read>(_dataTable.inArrayPtr); - var result = Sse41.Insert(firstOp, (float)2, 8); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_Load() - { - var firstOp = Sse.LoadVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 8); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclVarScenario_LoadAligned() - { - var firstOp = Sse.LoadAlignedVector128((Single*)(_dataTable.inArrayPtr)); - var result = Sse41.Insert(firstOp, (float)2, 8); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(firstOp, _dataTable.outArrayPtr); - } - - public void RunLclFldScenario() - { - var test = new SimpleUnaryOpTest__InsertSingle8(); - var result = Sse41.Insert(test._fld, (float)2, 8); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(test._fld, _dataTable.outArrayPtr); - } - - public void RunFldScenario() - { - var result = Sse41.Insert(_fld, (float)2, 8); - - Unsafe.Write(_dataTable.outArrayPtr, result); - ValidateResult(_fld, _dataTable.outArrayPtr); - } - - public void RunUnsupportedScenario() - { - Succeeded = false; - - try - { - RunBasicScenario_UnsafeRead(); - } - catch (PlatformNotSupportedException) - { - Succeeded = true; - } - } - - private void ValidateResult(Vector128 firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.WriteUnaligned(ref Unsafe.As(ref inArray[0]), firstOp); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(void* firstOp, void* result, [CallerMemberName] string method = "") - { - Single[] inArray = new Single[Op1ElementCount]; - Single[] outArray = new Single[RetElementCount]; - - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref inArray[0]), ref Unsafe.AsRef(firstOp), (uint)Unsafe.SizeOf>()); - Unsafe.CopyBlockUnaligned(ref Unsafe.As(ref outArray[0]), ref Unsafe.AsRef(result), (uint)Unsafe.SizeOf>()); - - ValidateResult(inArray, outArray, method); - } - - private void ValidateResult(Single[] firstOp, Single[] result, [CallerMemberName] string method = "") - { - - for (var i = 0; i < RetElementCount; i++) - { - if ((i == 0 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(2.0f) : i == 3 ? BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(0.0f) : BitConverter.SingleToInt32Bits(result[i]) != BitConverter.SingleToInt32Bits(firstOp[i]))) - { - Succeeded = false; - break; - } - } - - if (!Succeeded) - { - Console.WriteLine($"{nameof(Sse41)}.{nameof(Sse41.Insert)}(Vector128<9>): {method} failed:"); - Console.WriteLine($" firstOp: ({string.Join(", ", firstOp)})"); - Console.WriteLine($" result: ({string.Join(", ", result)})"); - Console.WriteLine(); - } - } - } -} diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Program.Sse41.cs b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Program.Sse41.cs index 195e1865b2b4..56eba9745c43 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Program.Sse41.cs +++ b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Program.Sse41.cs @@ -40,30 +40,18 @@ static Program() ["Floor.Single"] = FloorSingle, ["FloorScalar.Double"] = FloorScalarDouble, ["FloorScalar.Single"] = FloorScalarSingle, - ["Insert.Single.0"] = InsertSingle0, ["Insert.Byte.1"] = InsertByte1, ["Insert.SByte.1"] = InsertSByte1, ["Insert.Int32.1"] = InsertInt321, ["Insert.UInt32.1"] = InsertUInt321, ["Insert.Int64.1"] = InsertInt641, ["Insert.UInt64.1"] = InsertUInt641, - ["Insert.Single.1"] = InsertSingle1, - ["Insert.Single.2"] = InsertSingle2, - ["Insert.Single.4"] = InsertSingle4, - ["Insert.Single.8"] = InsertSingle8, - ["Insert.Single.16"] = InsertSingle16, - ["Insert.Single.32"] = InsertSingle32, - ["Insert.Single.48"] = InsertSingle48, - ["Insert.Single.64"] = InsertSingle64, - ["Insert.Single.128"] = InsertSingle128, ["Insert.Byte.129"] = InsertByte129, ["Insert.SByte.129"] = InsertSByte129, ["Insert.Int32.129"] = InsertInt32129, ["Insert.UInt32.129"] = InsertUInt32129, ["Insert.Int64.129"] = InsertInt64129, ["Insert.UInt64.129"] = InsertUInt64129, - ["Insert.Single.129"] = InsertSingle129, - ["Insert.Single.192"] = InsertSingle192, ["Max.Int32"] = MaxInt32, ["Max.SByte"] = MaxSByte, ["Max.UInt16"] = MaxUInt16, diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Sse41_r.csproj b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Sse41_r.csproj index e98e0c2acba7..4e018a4d1d83 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Sse41_r.csproj +++ b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Sse41_r.csproj @@ -133,30 +133,18 @@ - - - - - - - - - - - - diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Sse41_ro.csproj b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Sse41_ro.csproj index 171f917b8625..6a55a8462968 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Sse41_ro.csproj +++ b/tests/src/JIT/HardwareIntrinsics/X86/Sse41/Sse41_ro.csproj @@ -133,30 +133,18 @@ - - - - - - - - - - - -