diff options
author | Egor Chesakov <Egor.Chesakov@microsoft.com> | 2018-07-10 16:15:15 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-10 16:15:15 -0700 |
commit | a211090331c5e4830bb037fb078d199e2234b865 (patch) | |
tree | e62791a4153d543f02e75c47ea145885f905ee4d /tests/src/JIT/HardwareIntrinsics/X86/Fma_Vector256/MultiplyAddNegated.Single.cs | |
parent | f39809b6e560450daa299d7566ca6d861cb2c270 (diff) | |
download | coreclr-a211090331c5e4830bb037fb078d199e2234b865.tar.gz coreclr-a211090331c5e4830bb037fb078d199e2234b865.tar.bz2 coreclr-a211090331c5e4830bb037fb078d199e2234b865.zip |
Remove random.NextDouble() from JIT/HardwareIntrinsics tests (#18838)
* Add ProjectReference to CoreCLRTestLibrary.csproj in the corresponding C# project files
* Replace usages of random.NextDouble() from GenerateTests.csx with CoreCLRTestLibrary.Generator.GetSingle()/GetDouble()
* Regenerate test files
Diffstat (limited to 'tests/src/JIT/HardwareIntrinsics/X86/Fma_Vector256/MultiplyAddNegated.Single.cs')
-rw-r--r-- | tests/src/JIT/HardwareIntrinsics/X86/Fma_Vector256/MultiplyAddNegated.Single.cs | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Fma_Vector256/MultiplyAddNegated.Single.cs b/tests/src/JIT/HardwareIntrinsics/X86/Fma_Vector256/MultiplyAddNegated.Single.cs index 6e2f2acc64..3d67ba89f9 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Fma_Vector256/MultiplyAddNegated.Single.cs +++ b/tests/src/JIT/HardwareIntrinsics/X86/Fma_Vector256/MultiplyAddNegated.Single.cs @@ -102,11 +102,11 @@ namespace JIT.HardwareIntrinsics.X86 var testStruct = new TestStruct(); var random = new Random(); - for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); } + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref testStruct._fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Single>>()); - for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref testStruct._fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Single>>()); - for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = (float)(random.NextDouble()); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _clsVar3), ref Unsafe.As<Single, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector256<Single>>()); return testStruct; @@ -146,11 +146,11 @@ namespace JIT.HardwareIntrinsics.X86 { var random = new Random(); - for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); } + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _clsVar1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Single>>()); - for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _clsVar2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Single>>()); - for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = (float)(random.NextDouble()); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _clsVar3), ref Unsafe.As<Single, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector256<Single>>()); } @@ -160,16 +160,16 @@ namespace JIT.HardwareIntrinsics.X86 var random = new Random(); - for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); } + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _fld1), ref Unsafe.As<Single, byte>(ref _data1[0]), (uint)Unsafe.SizeOf<Vector256<Single>>()); - for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _fld2), ref Unsafe.As<Single, byte>(ref _data2[0]), (uint)Unsafe.SizeOf<Vector256<Single>>()); - for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = (float)(random.NextDouble()); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Single>, byte>(ref _fld3), ref Unsafe.As<Single, byte>(ref _data3[0]), (uint)Unsafe.SizeOf<Vector256<Single>>()); - for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = (float)(random.NextDouble()); } - for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = (float)(random.NextDouble()); } - for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = (float)(random.NextDouble()); } + for (var i = 0; i < Op1ElementCount; i++) { _data1[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op2ElementCount; i++) { _data2[i] = TestLibrary.Generator.GetSingle(); } + for (var i = 0; i < Op3ElementCount; i++) { _data3[i] = TestLibrary.Generator.GetSingle(); } _dataTable = new SimpleTernaryOpTest__DataTable<Single, Single, Single, Single>(_data1, _data2, _data3, new Single[RetElementCount], LargestVectorSize); } |