diff options
Diffstat (limited to 'tests/src/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.UInt64.cs')
-rw-r--r-- | tests/src/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.UInt64.cs | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.UInt64.cs b/tests/src/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.UInt64.cs index 85295c05ef..3e504b119e 100644 --- a/tests/src/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.UInt64.cs +++ b/tests/src/JIT/HardwareIntrinsics/X86/Avx/ExtendToVector256.UInt64.cs @@ -85,10 +85,10 @@ namespace JIT.HardwareIntrinsics.X86 public sealed unsafe class SimpleUnaryOpTest__ExtendToVector256UInt64 { - private const int VectorSize = 32; + private static readonly int LargestVectorSize = 32; - private const int Op1ElementCount = VectorSize / sizeof(UInt64); - private const int RetElementCount = VectorSize / sizeof(UInt64); + private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector128<UInt64>>() / sizeof(UInt64); + private static readonly int RetElementCount = Unsafe.SizeOf<Vector256<UInt64>>() / sizeof(UInt64); private static UInt64[] _data = new UInt64[Op1ElementCount]; @@ -103,7 +103,7 @@ namespace JIT.HardwareIntrinsics.X86 var random = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (ulong)(random.Next(0, int.MaxValue)); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar), ref Unsafe.As<UInt64, byte>(ref _data[0]), VectorSize); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _clsVar), ref Unsafe.As<UInt64, byte>(ref _data[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); } public SimpleUnaryOpTest__ExtendToVector256UInt64() @@ -113,10 +113,10 @@ namespace JIT.HardwareIntrinsics.X86 var random = new Random(); for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (ulong)(random.Next(0, int.MaxValue)); } - Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld), ref Unsafe.As<UInt64, byte>(ref _data[0]), VectorSize); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector128<UInt64>, byte>(ref _fld), ref Unsafe.As<UInt64, byte>(ref _data[0]), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (ulong)(random.Next(0, int.MaxValue)); } - _dataTable = new SimpleUnaryOpTest__DataTable<UInt64, UInt64>(_data, new UInt64[RetElementCount], VectorSize); + _dataTable = new SimpleUnaryOpTest__DataTable<UInt64, UInt64>(_data, new UInt64[RetElementCount], LargestVectorSize); } public bool IsSupported => Avx.IsSupported; @@ -262,8 +262,8 @@ namespace JIT.HardwareIntrinsics.X86 UInt64[] inArray = new UInt64[Op1ElementCount]; UInt64[] outArray = new UInt64[RetElementCount]; - Unsafe.Write(Unsafe.AsPointer(ref inArray[0]), firstOp); - Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); + Unsafe.WriteUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray[0]), firstOp); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<UInt64>>()); ValidateResult(inArray, outArray, method); } @@ -273,8 +273,8 @@ namespace JIT.HardwareIntrinsics.X86 UInt64[] inArray = new UInt64[Op1ElementCount]; UInt64[] outArray = new UInt64[RetElementCount]; - Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray[0]), ref Unsafe.AsRef<byte>(firstOp), VectorSize); - Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref inArray[0]), ref Unsafe.AsRef<byte>(firstOp), (uint)Unsafe.SizeOf<Vector128<UInt64>>()); + Unsafe.CopyBlockUnaligned(ref Unsafe.As<UInt64, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<UInt64>>()); ValidateResult(inArray, outArray, method); } |