summaryrefslogtreecommitdiff
path: root/tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int32.6.cs
diff options
context:
space:
mode:
Diffstat (limited to 'tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int32.6.cs')
-rw-r--r--tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int32.6.cs20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int32.6.cs b/tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int32.6.cs
index a9a7a6ce9d..2b1da87840 100644
--- a/tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int32.6.cs
+++ b/tests/src/JIT/HardwareIntrinsics/X86/Avx/Insert.Int32.6.cs
@@ -92,10 +92,10 @@ namespace JIT.HardwareIntrinsics.X86
public sealed unsafe class SimpleUnaryOpTest__InsertInt326
{
- private const int VectorSize = 32;
+ private static readonly int LargestVectorSize = 32;
- private const int Op1ElementCount = VectorSize / sizeof(Int32);
- private const int RetElementCount = VectorSize / sizeof(Int32);
+ private static readonly int Op1ElementCount = Unsafe.SizeOf<Vector256<Int32>>() / sizeof(Int32);
+ private static readonly int RetElementCount = Unsafe.SizeOf<Vector256<Int32>>() / sizeof(Int32);
private static Int32[] _data = new Int32[Op1ElementCount];
@@ -110,7 +110,7 @@ namespace JIT.HardwareIntrinsics.X86
var random = new Random();
for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (int)0; }
- Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Int32>, byte>(ref _clsVar), ref Unsafe.As<Int32, byte>(ref _data[0]), VectorSize);
+ Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Int32>, byte>(ref _clsVar), ref Unsafe.As<Int32, byte>(ref _data[0]), (uint)Unsafe.SizeOf<Vector256<Int32>>());
}
public SimpleUnaryOpTest__InsertInt326()
@@ -120,10 +120,10 @@ namespace JIT.HardwareIntrinsics.X86
var random = new Random();
for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (int)0; }
- Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Int32>, byte>(ref _fld), ref Unsafe.As<Int32, byte>(ref _data[0]), VectorSize);
+ Unsafe.CopyBlockUnaligned(ref Unsafe.As<Vector256<Int32>, byte>(ref _fld), ref Unsafe.As<Int32, byte>(ref _data[0]), (uint)Unsafe.SizeOf<Vector256<Int32>>());
for (var i = 0; i < Op1ElementCount; i++) { _data[i] = (int)0; }
- _dataTable = new SimpleUnaryOpTest__DataTable<Int32, Int32>(_data, new Int32[RetElementCount], VectorSize);
+ _dataTable = new SimpleUnaryOpTest__DataTable<Int32, Int32>(_data, new Int32[RetElementCount], LargestVectorSize);
}
public bool IsSupported => Avx.IsSupported;
@@ -280,8 +280,8 @@ namespace JIT.HardwareIntrinsics.X86
Int32[] inArray = new Int32[Op1ElementCount];
Int32[] outArray = new Int32[RetElementCount];
- Unsafe.Write(Unsafe.AsPointer(ref inArray[0]), firstOp);
- Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize);
+ Unsafe.WriteUnaligned(ref Unsafe.As<Int32, byte>(ref inArray[0]), firstOp);
+ Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<Int32>>());
ValidateResult(inArray, outArray, method);
}
@@ -291,8 +291,8 @@ namespace JIT.HardwareIntrinsics.X86
Int32[] inArray = new Int32[Op1ElementCount];
Int32[] outArray = new Int32[RetElementCount];
- Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray[0]), ref Unsafe.AsRef<byte>(firstOp), VectorSize);
- Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), VectorSize);
+ Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref inArray[0]), ref Unsafe.AsRef<byte>(firstOp), (uint)Unsafe.SizeOf<Vector256<Int32>>());
+ Unsafe.CopyBlockUnaligned(ref Unsafe.As<Int32, byte>(ref outArray[0]), ref Unsafe.AsRef<byte>(result), (uint)Unsafe.SizeOf<Vector256<Int32>>());
ValidateResult(inArray, outArray, method);
}